Max beginnings at third, fourth hour

Started by Artur Sokolowski, August 27, 2026, 04:50:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Artur Sokolowski

Hello again ;-)
I have a timetable for grades 1–8. I'd like to set a condition so that grades 1–3 starts no later than the second hour. Here I have the option "A students set begins early (max beginnings at second hour)." It works fine. Now, for grades 4–6, I'd like the option to have them starts no later than the third hour (max beginnings at third hour). And for grades 7–8, I'd like them to starts no later than the fourth hour (max beginnings at fourth hour). What's the easiest way to set this up? Right now, I'm limiting class availability during the last few hours, but I suspect this isn't the best solution ;-)

Volker Dirr

3 hours later? I never expected that a school need that. Is that because of limited rooms?

I assume students have a constraint with 0 gaps per week with 100%. In that case you can just use use the "activities occupy min time slots from a selection". Then for groups in grade 8 you select all 4th hours of a week and set at least 5 (or better "number of days per week") activities must be placed in the 5 (or better "number of days per week") selected time slots.

Artur Sokolowski

Hello Volker
Unfortunately, that's the reality at our school. There's a limited number of classrooms, and in each grade there are at least two subjects that must start or end the students day (including one subject taught by only one teacher); some classes can't be scheduled later in the day, etc. I always start drawing up the schedule with this restriction: classes must start no later than the second hour. If the schedule doesn't work out, I relax the restrictions for older grades and let them start later. And, of course, there can't be any gaps in any grade. Thank you very much for the suggestion — that's exactly what I need.

Artur Sokolowski

Thanks again Volker, tested and working just fine ;-)

Liviu Lalescu

Possible optimization tip: maybe, if you select all slots in which students need activities, might be more efficient for the algorithm. If the students have min 4 hours daily, you could select all these 20 hours, and min occupied = 20. The reason is that FET might refuse earlier impossible assignments. But I am not sure, maybe the gaps and min/max hours daily for students make this trick unnecessary. Also, if the constraint has more slots selected, it might be slower. I would prefer with 20 slots selected.

We need a comparison.

Artur Sokolowski

Hi Liviu
So far, I'm happy with the current solution. I've managed to fine-tune it a bit more, and grades 1–3 start no later than the second hour, while grades 4–8 start no later than the third. For each class, I've set minimum and maximum daily hours with 0 gaps. For class 4A in the figure, the minimum is 5 and the maximum is 7 (plus, there's one after-school activity). I can't have a difference of more than 2 hours on any given day (excluded after-school activity). It takes about 20–30 minutes to generate the schedule, which is acceptable to me. Thank you so much for the extra help. I'll try testing those two options when I have a chance. For now, I still need to make some final adjustments; yesterday, one of the teachers quit, so I have to figure out a way to patch things up ;-) Thanks to superb FET I don't have to figure things out on my own and make manual corrections, which would take far too much time. But I still remember how, a dozen or so years ago, I used to draw up the timetable by hand. And then I discovered FETs, and my world changed ;D
Best regards

Liviu Lalescu

Oh, great, Artur, thank you for your kind words!  :)