# Automation

### From Lantiv User's Guide

For many schools, principals and timetable administrators, the automatic engine of the program is a gigantic time saver. It is in fact a highly intelligent mechanism irreplaceable by any manual means of timetable construction. Let's understand a little bit how it works internally before we describe how to operate it.

## The Algorithm

The basic idea behind the automation algorithm is surprisingly simple. It's all about improvement - gradual and well calculated improvement. You see, the problem of timetable construction is broken into a series of moves, the goal of each of them being to somehow improve the timetable. In each step of this process the program evaluates what is currently wrong with the timetable based on the data and constraints that you have entered. It then picks the most critical violation and dedicates a certain amount of time to finding a way to resolve it. At first, the program dedicates only 3 seconds to finding such resolutions. This way, the easy violations are resolved quickly at the first iteration.

The violations which were not resolved in the first iteration are moved to what we call a "pending queue". In the second iteration the program increases the time dedicated to solving each problem to 15 seconds and gives another shot at resolving the pending queue violations from the previous iteration. This process is then repeated several times, while increasing the time more and more in each new iteration. Basically that's it.

There is just one more thing which is important to understand about the automation algorithm and that is how exactly the algorithm evaluates whether a move improves the timetable or not. As you remember, each constraint is essentially a mathematical formula which sums up something in the timetable. When you enter a constraint, you simply put a limitation on the outcome of this formula for a specific resource. Now, a violation happens when the outcome is not within the Min/Max limitation range that you have defined. And the difference between the outcome and the Minimum or the Maximum is in fact the Violation's score. What the program does to evaluate a timetable, is to sum up the scores of all the violated constraints. It then reaches an absolute number which is the timetable's total score. That total score is what the program looks at when it decides whether a move improves the timetable or not – if the combined effect of a move in fact improves the score, the move is considered as benefiting and is applied as an improvement.

## Launching the Automation

In order to enter the Automatic mode of timetable construction you need to click on "Automatic" at the bottom right corner of the screen.

Once you do, the program will swap the Resources and Activities pane with the Violations pane. The Violations pane lists all the unfulfilled constraints in the current timetable. These violations are the ones which the automatic solver will be working on during the automatic timetable construction. Note that unscheduled activities are also considered as violations of the "Scheduling" constraint and they will also be listed in the Violations pane.

In order to launch the automation, all you have to do is click on the "Solve All" button at the bottom of the Violations pane. That's it. The program will start resolving all the existing problems one by one. The progress of the automation will be summed up by three statistical details at the bottom of the Violations window:

**The number of remaining problems**– this is the number of problems (violations) which the automatic engine will be solving in the next iteration.**The number of improvements made**– this is the number of "moves" made in order to improve the timetable. Note that this number will be higher than the number of problems because it usually takes multiple "improvement steps" in order to fully resolve a violation. For example, if one violation consists of two extra gaps, it would usually take two improvement steps to close these two gaps.**Pending problems without solution**– this is the number of violations which the program could not resolve at the current iteration. The program will attempt to resolve them in the next iteration by dedicating more time to finding a resolution for each of them.

You can stop the automatic solver at any time by clicking on the "Stop" button.

The Violations pane contains two additional buttons at the bottom: "Solve" and "Ignore". The "Solve" button can be used to launch the automation for a specific violation in the list. You need to select the violated constraint in the Violations list and then click on "Solve".

"Ignore" can be used to ask the program to temporarily ignore a violated constraint. This means that the program will ignore the limitation value you entered for the constraint and act as if not limitation was set. Note that the "ignore mark" is not saved, so if you need to constantly ignore a constraint, you should really remove the Min/Max/Desirable values you have entered.

## Resuming the Automation

Even if the timetable is partially or fully constructed, you always have the option to modify the existing constraints and then run the automation again from that point. The program knows how to take the existing timetable as a starting position and automatically make the necessary adjustments to make it fulfill the new constraints. In fact, this ability can be used as a technique to construct the timetable gradually because you can run the automation multiple times. The reason this can be useful is because it is often very difficult to enter all the constraints correctly from the beginning. You may well find yourself looking at the resulting timetable after the first phase and saying something like "Oh, this also needs to be like this and that". In such cases you can always go back to the constraints entry and enter the additional constraints or you can make a manual change and fixate it, and then run the automatic solver again. Following this process several times is actually the recommended method of achieving the highest quality timetable.