max one gap per day, no matter how long

Started by balacco, July 29, 2023, 09:35:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hello, I am preparing the timetable for the next school year. We need each teacher to cover many first hours and many last (=sixth) hour. As a consequence, almost every teacher has a day with both the first and the last hour. Some teachers don't want more than four lessons in that day. FET accomplishes this nicely most of the times. For example: lessons from 8 to 10, a two-hours gap, then lessons again from 12 to 14. This is good. Lessons from 8 to 11 and from 13 to 14 is just as good.
In very few cases, however, FET can insert separated gaps in the same day. For example, lesson from 8 to 10, gap, lesson from 11 to 12, another gap, lesson from 13 to 14. This is very very bad. I would like to see a new option (for all teachers): gaps are consecutive if they fell on the same day. I am new to FET, maybe you have already discussed this idea but I haven't found it on the forum.

Volker Dirr

As a workaround you might add a pseudo activity with duration 2 (so only the teacher, no students. Maybe call the subject "free") and in return you reduce the max gaps per day/week by 2. So the total number of max gaps is still the same.

Liviu Lalescu

Hello, @balacco , and welcome to the forum!

1) If you want a teacher to have activities, mandatory, in certain slots, you can use the constraint activities occupy min time slots from selection.

2) If you want a day to be divided into two parts, and in each part the teacher should not have gaps, you might be able to use the Mornings-Afternoons mode. There are 5*2 days per week and 3 hours per day. Please read the help for this mode (Morocco and Algeria, but you'll use Algeria-style teachers).

I hope it will work. You might be able to convert your file directly to this mode by simply selecting this mode from the File menu, but please backup your file and keep the old one. And you might need to adjust some data.


Thanks a lot for the prompt help. It seems, however, that none of your suggestion is satisfactory. I have tried to change mode and, suddenly, all the constrains with a key have been removed. This is even worse that having two gaps.
I don't want to force any activity to fall in a certain slot. It just happens. I can't predict which teacher will get both the first and the last slot and which day o the week, therefore I don't know how to apply your other suggestions.
I really value your help, it adds to an already wonderful program. Nonetheless I suggest you, maybe next year, to add the new constrain "all gaps in the same day must be consecutive".

Liviu Lalescu

I will add your suggestion (teachers/students all gaps on the same day must be consecutive) in the TODO list. However, I think it was already suggested in the past by other users and I think a solution is impossible or too complicated.

About changing the mode: I told you that some constraints might be lost or modified. FET will inform you which of them. The reason is that you'll have only 3 hours per day instead of 6, and 10 days per week instead of 5. Also, you might need to change some constraints, for instance teacher max days per week to teacher max real days per week (in the Mornings-Afternoons mode we have days = half days and real days, only the min/max (half) days between activities keep the half day/day notation).

I still think that the Mornings-Afternoons mode might work for you, but you need a bit of care when converting, and to read about it. You have also some examples.

Note that FET half day 1 = Monday morning, 2 = Monday afternoon, 3 = Tuesday morning, and so on.


I care for students as much as for teachers. Therefore I had devised the following trick. I have added to each activity a key which can be either heavy or light (actually I use § for heavy and ~ for light). Then I have added three constrains. The first one, for example, is:
Tutti gli studenti per attività con chiave devono rispettare il numero massimo di ore al giorno
Peso (percentuale)=100%
Chiave dell'attività=§
Max ore al giorno=5
and so on...
In most cases students have an optimal distribution of both kinds of activities during the week.
I really like the results and don't want to renounce to what I got.
When changing mode, these constrains have been removed immediately.

All considered, I still prefer the solution of limiting gaps to 1 hour per day, only for those teachers who refuse two non consecutive gaps. This can already be done.

Liviu Lalescu

I see. I just checked, the corresponding constraint in the Mornings-Afternoons mode is teachers/students activity tag max hours per real day. So the Official mode constraint is removed. If you want to convert to the MA mode, you need to add the corresponding constraints again.

Any working solution is good. And the MA mode might not be what you need. I am not sure.

The MA mode might be an overkill for your data. I mean more complicated than needed.