Weights of constraints and relative priorities

Started by maxi_mus, January 19, 2024, 03:53:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maxi_mus

I have a general question regarding the use of weights in FET.

As far as I understand it weights in FET are tied to the number of retries to try and find a solution.

Let's say I want to do something like this: I would like to have a constraint like 'a set of activities has a set of preferred time slots', but I want this constraint to only have an effect IF no additional gaps for teachers are introduced. Is this possible?

Also, is it possible to somehow minimize maximum gaps per week for a teacher / for all teachers? The given constraint 'Max gaps per week for a teacher / for all teachers' only allows a fixed number, and the constraint with the fixed number has to be a hard constraint (100%). Is this the only way to minimize gaps?

Liviu Lalescu

A very long time ago, with a proprietary program, I noticed that if I did not put a limit on teachers' gaps and let the program generate, it found 4 gaps at best. If I specifically put max 2 gaps, it found a timetable in a comparable time. Also in FET, I deduced that it is best to allow only 100% for the max gaps constraints. Otherwise, the timetable would be weak. Or maybe a weight like 99.999% might be useful, but I am not sure.

It might be possible to set this condition, as a custom version, but looks complicated, I am not sure.

Yes, in the official FET the only way to minimize the gaps is to use 100% and progressively lower this value as you find new timetables. It might be possible in a custom version to add weights <100% for max gaps, but unfortunately now, after so many other constraints depending on max gaps only having 100%, this would imply many difficult changes.

maxi_mus

OK, so if I understand you correctly, the only way to do what I want with the given rules is to manually try lowering the maximum gaps teacher per teacher, and when I have optimized this, only then try with nice-to-have  rules that try to achieve certain goals regarding a set of activities has a set of preferred time slots?

A slightly related question, there is no way to redefine what exactly counts as a gap, right?

If a teacher has a lesson in hour 1, and the next one in hour 4, does this count as 1 or 2 gaps?

Depending on the answer this might actually be THE reason why I will always use MA mode. Because in my country, having a gap between morning and afternoon lessons isn't all that relevant, especially for teachers who live close to the school. What's much more relevant is having no gaps within the morning and within the afternoon, and to have at least 2 lessons per morning or afternoon.

Liviu Lalescu

#3
Yes, indeed. And after optimizing the gaps, you could use subactivities preferred times, only for the first component, with 100%, and so on, because working with weights <100% for preferred times is not very good (in general, weights <100% are to be avoided, except min days between activities).

Two gaps, categorically. Maybe one gap counting could be possible as a customization, but might be very complicated and implemented not perfectly, I am not sure.

Yes, definitely use the Mornings-Afternoons mode.

maxi_mus

Is it possible to somehow change mode or do I have to reenter all the data again?

Liviu Lalescu

#5
Oh, no reentering :)

File menu, Mode, Mornings-Afternoons (with your Official mode file opened). FET will inform you of the potential problems regarding the conversion.

Then you'll need to modify a bit the preferred times constraints and I am not sure if the constraints of type teachers/students min max days per week to be for real day, but only if you have these constraints.

But, by all means, make a backup before and keep it.

maxi_mus

Thank you! One more question regarding gaps and then I'll stop bugging you and try to figure stuff out myself, at least til next week :D

In MA mode, is it still possible to make a constraint for gaps between morning and afternoon lessons?

Liviu Lalescu

You are welcome!

I just checked, and I think you mean the existing constraints teachers/students max gaps per real day and teachers/students max gaps per week per real day. You need to enable these constraints first (don't worry, they work well).

maxi_mus

Quote from: Liviu Lalescu on January 19, 2024, 07:35:41 PMFile menu, Mode, Mornings-Afternoons (with your Official mode file opened). FET will inform you of the potential problems regarding the conversion.

Then you'll need to modify a bit the preferred times constraints and I am not sure if the constraints of type teachers/students min max days per week to be for real day, but only if you have these constraints.


But what do I have to change about the days and hours? After changing mode, there are still the same 5 days and the same hours... Do I have to make pseudo-days Monday morning, monday afternoon etc.? I cannot find anything about this in the 2 user manuals nor the FAQ...

Liviu Lalescu

Modify the days and the hours: make 10 FET days and max(real hours morning, real hours afternoon) FET hours.

maxi_mus

I'm sorry, but I need some more help on this topic, I searched the forum and the documentation, but came up short.

I did what you said (10 FET days, the hours are still the same as before). How can I now map the correct hours to the according days? You said in post #7 that it's possible to set gaps for real days, but how does FET even know what a real day is now?

Is this defined by the order of the days?

Liviu Lalescu

There is Help for Morocco/Algeria in FET, and examples.

FET day 1 is real day 1 morning, FET day 2 is real day 1 afternoon, ..., FET day 10 is real day 5 afternoon.

FET will consider a real day gap = sum of gaps from FET day 1 and FET day 2 and the gaps between these two FET days.

maxi_mus

Ok, but how do I map the correct hours to the half days? Or do all hours exist on all days, and I have to for example disable any activities on (FET day) monday morning (hours) afternoon hours, monday afternoon morning hours, etc.?

Liviu Lalescu

I do not understand exactly.

In Morocco and Algeria they have 4 hours in the morning and 4 in the afternoon (in some schools 5 morning and 5 afternoon hours). They also have 5 or 6 real days. So there are 10 or 12 FET days, and 4 or 5 hours per FET day.

maxi_mus

Ah, now I understand. I misread what you wrote on post #9:

QuoteModify the days and the hours: make 10 FET days and max(real hours morning, real hours afternoon) FET hours.


I thought you meant to keep all the real hours. This means there are no actual hours (real time of day) in MA mode, just slots.

So if a school has 5 slots in the morning and 4 in the afternoon, then I guess FET will just act as if there are also 5 in the afternoon, but I have to disable all activities on the 5th slot of the afternoon, correct?