Hello, everyone, I'm new to the forum, and I am excited to use FET for my grade school's scheduling needs.
What I need is a way to make the following constraint:
If Activity1 comes first, then Activity2 can be consecutive
But, if Activity2 comes first, then Activity1 must have at least 1 period in between.
For example, if the algorithm places Dance in 1st hour, then Wrestling can be placed in 2nd hour, but if Wrestling is placed in 1st hour, then Dance must be at least in 3rd hour, if not farther away.
A simpler, but less useful solution could be a constraint that says:
Activity1 and Activity2 will not be consecutive.
Thank you for your help.
I have a very good solution for you, but it is a bit complicated to add.
Suppose you have activities A1 and A2. Add dummy A3, with duration 1, no teachers and no students. Add constraint 2 activities consecutive, A2 and A3 (A2 followed by A3). Add constraint activities not overlapping, A1 and A3.
There is only a small problem: A2 cannot be put in the last period. To correct that: increase the number of hours with 1 and constrain all the real activities (without A3) to take place in the first periods. You can do that by adding a subject tag to A1 and A2 (and all your activities) named Early and a subject tag to A3 named Any, and add constraint activities preferred times for subject tag Early to be in the first n-1 slots of each day (last slot in each day not allowed).
Please let me know if this is OK.
I'll add this question+answer in the FAQ.
That is a bit complicated, but quite clever. I'll try it and see how it works , and let you know.
Thanks!