How work with simultaneous but different working hours?

Started by igorsch, March 14, 2025, 02:01:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

Hello!

The new official version is just released. Thank you for your suggestion!

igorsch

Thanks! Downloading now, must finish a timetable today.

yush

Come here because of the new feature which solved this problem. But I think we could have solved this without the new feature.

Since the the overlapping time slots are alternating, we can set up the hours like this:

18h30 - 19h20
19h00 - 19h45
19h20 - 20h10
19h45 - 20h30
20h20 - 21h10
20h30 - 21h15
21h10 - 22h00
21h15 - 22h00

In other words, the overlapping timeslots are consecutive.

Then, we can add an Activity tag for each course, a different one for each set of overlaping timeslots. For example, Overlaps-18:30/19:00, Overlaps-19:00/19:20, etc.

Use the "min gap (hours) between a set of activities" constraint for each set of the courses with the same overlaps-xx tag. Make the min gap to be 1, so they cannot be consecutive.

Would that work?





Liviu Lalescu

I think there are more reasons it won't work:

1) There are many activities with duration 2. Otherwise, I would have also used this approach, but with teachers max 1 hours daily in two adjacent overlapping intervals.

2) You don't know which activities end up in which interval. You don't know the activity tags before the generation, but only after.

igorsch

Quote from: yush on March 19, 2025, 07:28:05 PMCome here because of the new feature which solved this problem. But I think we could have solved this without the new feature.

Since the the overlapping time slots are alternating, we can set up the hours like this:

18h30 - 19h20
19h00 - 19h45
19h20 - 20h10
19h45 - 20h30
20h20 - 21h10
20h30 - 21h15
21h10 - 22h00
21h15 - 22h00

In other words, the overlapping timeslots are consecutive.

Then, we can add an Activity tag for each course, a different one for each set of overlaping timeslots. For example, Overlaps-18:30/19:00, Overlaps-19:00/19:20, etc.

Use the "min gap (hours) between a set of activities" constraint for each set of the courses with the same overlaps-xx tag. Make the min gap to be 1, so they cannot be consecutive.

Would that work?






I timetable created in such way could be confusing to read, specially for someone not involved in generation.

yush

Ah, I jumped to the conclusion that each course would only occupy one timeslot. However, it might still work. If we think of the timeslots as "starting" time, and ignore the end time. We have:

18:30A
19:00B
19:20A
19:45B
20:20A

20:30B
21:10A
21:15B

With the A/B indicating what type of schedule it is on. If a teacher has a class of 2 timeslots in the "A" schedule, say, from 19:20A to 20:20A, we put the activities as having a duration of 3 hours, not 2. That's because it encloses the 19:35B timeslot.

The next timeslot that cannot be scheduled is 20:30B. So, by enforcing a min 1 hour gap, it ensure that we will have no overlaps.

Actaully, we don't need to have different activty tags for different pairs of consecutives. Just one tag for all activities from 18:30 to 22:00, because these are the hours that have the overlap problem.

Of course, even if this work for this case, it the same trick likely will not work for other overlapping timeslots configuration. The mutually exclusive constraint is definiely a nice addition!

Liviu Lalescu

I am not convinced that it would work. You could get igorsch's file from reply #2 and see it. There are 6 conflicts: hours 13 and 17, 14 & 17, 14 & 18, 15 & 19, 16 & 19, 16 & 20.

Thank you for the appreciation!