Hello!
The problem: two teachers move from their home city to their school together (with the same car). It would be very useful if they had their activities overlapping. If I don't want to use the constraint "A teacher's not available times", but some kind of exact opposite of the constraint Activities->"A set of activities are not overlapping", what should I do? A constraint of the type "A set of activities are overlapping" would be really useful...
Thanks a lot!
I fear such a constraint will be much to strict, because it mean also the gaps are at the same time, even that isn't needed.
A workaround might be adding that teachers togeher into one (or more) pseudo activities (mayve even with duration 2 or more) and allow to place those activities only at the start or end of a day. So they have both free the same time and so can go home or come from home the same time.
Actually, the gaps don't need to coincide. I was thinking of the following solution:
If the total hours of the school is n and the total teaching hours of the 1st teacher is m, then I can add pseudo-activities of the one of the teachers for n-m hours. Then, I can give the constraint "a set of activities are not overlapping" and input the real activities of the 2nd teacher with the pseudo-actitivies of the 1st one, with weight percentage let's say 95%.
What do you think?
with "a set of activities are not overlapping" it won't work.
with "a set of activities are overlapping" it maybe might work. But sadly it also mean the gaps will be at the same time. That is very strikt. I fear it will become very difficult dataset to normal school data.
That is why i suggested to add pseudo activities with both teachers in the same "free" activity. By that both teachers come later to school together or drive home later together.
ah... i missunderstood. You want to overlap with the not available activities. hmmm.. might work. but it will be difficult to care about gaps then, because that hours doesn't count as gaps. So your care problem is solved with your idea better then with my one, but you can't care about gaps anymore.
OK! Thanks!
Say teacher T1 has m activities and T2 has n activities, m>n. Add a constraint activities occupy max time slots from selection, selected activities = those m+n, selected slots = all slots of the week, max occupied = m.
Thank you Liviu! I'm going to try your solution!
Liviu, I tried your solution and it works! Thanks again! I think that the max hours are actually (can be at most) n and not m (n<m), but this is not important. The weight percentage for this constraint can be just 100%. Of course I can give a smaller number of hours (<n) for generating a timetable with fewer hours overlapping, but the percentage could take smaller values in order to achieve a similar result (but this means that you have to change the code...). I think that giving the option to reduce the percentage might be an easier way of handling the same problem (for some users).
Sorry, I think I made a mistake! The number m (and not n) seems to be OK... I didn't understand a crucial point correctly...
Do you still need percentage under 100%? This is too difficult for me.
Quote from: Liviu Lalescu on September 18, 2015, 06:18:28 AM
Say teacher T1 has m activities and T2 has n activities, m>n. Add a constraint activities occupy max time slots from selection, selected activities = those m+n, selected slots = all slots of the week, max occupied = m.
Oh, yes. I forgot this. But this solution also mean that the gaps will be also simoultanously. That is (maybe) to strikt. Maybe it help if you occupie max m+allowed_gaps. The disadvantage might be, that the gap is maybe at the border.
Quote from: Liviu Lalescu on September 18, 2015, 01:37:43 PM
Do you still need percentage under 100%? This is too difficult for me.
No Liviu. It's not necessary. I can just increase the number of time slots. The result is the same...