Min hours daily per real day for all teachers

Started by maxi_mus, January 31, 2024, 12:04:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maxi_mus

I need some help with the constraint 'Min hours daily per real day for all teachers'.

I have a pseudo-activity on an afternoon for a teacher meeting. However, some teachers show up on that day only for that meeting, so setting a minimum of 2 hours won't work.

Is there any elegant way around this?

Also, a general question regarding these daily/morning/afternoon minimums & maximums: Is there a reason why these constraints can only be chosen globally and nor for individual days?

Liviu Lalescu

I think you need to add multiple constraints for each teacher with a single click ("Add constraintS" button), then deactivate for the necessary teachers.

Not for individual days: I think nobody else in 20 years suggested this (maybe a user or two asked for a single day maybe). You can use activities occupy min/max time slots from selection, but you might need to add a lot of constraints.

maxi_mus

Quote from: Liviu Lalescu on January 31, 2024, 12:11:06 PMI think you need to add multiple constraints for each teacher with a single click ("Add constraintS" button), then deactivate for the necessary teachers.


Thanks. I thought of that solution too. The problem is, then those teachers won't have the constraint on all the other days, which is necessary.

(Now you also see why I asked about the individual days...)

I solved it with this hack for the time being: I just extended the meeting to length 2 hours, but that's not really an elegant solution.

Liviu Lalescu

You could add a dummy activity (no students) for the teachers with only 1 hour on the meeting day, and constrain this dummy and the meeting to be grouped or same day.

Volker Dirr

Similar here: Always think about advantages and disadvantages.

I will exmplain with my data set.
We have over 50 teachers. But only 24 classes.
We also have a teacher meeting on Tuesday 7&8 hour.
So of course i don't need all at the same time.
Impossible to let them all work Tuesday in the 6th hour. Most of them will have free.
If i add a constraint like min 3 hours per day, then of course it will help to have them in school on Tuesday. So that is an advantage.
The disadvantage is, that it will increase the number of gaps, but it won't save the time to travel to school. So the wasted time on traveling to school will be the same, but the number gaps will be higher.
Without such a min 3 hours on Tuesday rule my data set might be in best case solve able without any gap for all teachers. As soon as i add such a rule like min hours on Tuesday, i know that at least have of the teachers ill have a gap in the 6th hour.
So if you add rules like that, you should always think about also what happens to the number of gaps for the teachers and if they can save travel time to school by that.

maxi_mus

Yes, that is actually one of the biggest problems I see with this concrete schedule. On the one hand, teachers have to attend the meeting, so there is no reason why the meeting shouldn't be counted for gaps. On the other hand, Thursday (the day of the meeting) will inevitably have more gaps due to this, which will probably lead to a worse overall schedule when trying to minimize gaps.

That is why in an ideal world or if I programmed something like FET from scratch, I would include the possibility of having constraints like this (as an example): Limit gaps to say one per day for Monday-Wednesday and Friday, and set a different value for Thursday. (Instead of setting a global maximum for the week or for every weekday.)

Volker Dirr

Well, in fact the number of gaps will be higher, even if the min day rule is only on one day.

maxi_mus

They could be higher, yes. But my strategy would be to set those constraints as hard constraints and then continuously lower the overall value (for individual or all teachers) until I reach the optimum.

Volker Dirr

Yes. Of course. But never the less it will be higher than without it.

It is more a psychological problem. Similar like the min 2 hours per day constraint. If you think closely about it, it is a stupid rule, since it might increase the gaps. In fact it doesn't matter if you are 2 hours at school or only 1. The travel time to school won't be reduced by that. So even most guys don't like only 1 hours per day, the real needed/wanted constraint is a lower max days per week.
But i admit that i also add min 2 hours per day rule, even in fact it is stupid to add it. But most guys don't understand it.
It is a bit like most guys think a mushroom is a plant. Even if you ask nature scientist they will tell you that a mushroom is more an animal.
Most guys don't understand it and so even nature scientist call it a plant if they talk with "normal" guys and they call it more animal if they talk to each other.

maxi_mus

I completely understand where you're coming from. That is another thing I am only using because the teachers want me too.

In real life, a person who lives very close to the school probably for example won't mind if he has a longer break over lunch, so again in an ideal world different types of gaps could be weighted differently. Everyone cares about free whole or half days though of course.

maxi_mus

Quote from: Liviu Lalescu on January 31, 2024, 12:20:12 PMYou could add a dummy activity (no students) for the teachers with only 1 hour on the meeting day, and constrain this dummy and the meeting to be grouped or same day.

Yes that's what I basically did, the meeting itself is a dummy. But it's not possible that two dummies occupy the same slot though, right?

Liviu Lalescu

Quote from: maxi_mus on January 31, 2024, 01:21:24 PMThat is why in an ideal world or if I programmed something like FET from scratch, I would include the possibility of having constraints like this (as an example): Limit gaps to say one per day for Monday-Wednesday and Friday, and set a different value for Thursday. (Instead of setting a global maximum for the week or for every weekday.)

There are solutions:

1. Add dummy activities (only a teacher), preferred times only on Thursday. Durations for each should be 1 FET hour.

2. A customization (which might be very tricky, and I am really afraid to add this to the official FET).

Liviu Lalescu

Quote from: maxi_mus on January 31, 2024, 01:49:08 PM
Quote from: Liviu Lalescu on January 31, 2024, 12:20:12 PMYou could add a dummy activity (no students) for the teachers with only 1 hour on the meeting day, and constrain this dummy and the meeting to be grouped or same day.

Yes that's what I basically did, the meeting itself is a dummy. But it's not possible that two dummies occupy the same slot though, right?

Sorry, I don't understand. If two activities have different teachers and no students, they can be in the same slot.

maxi_mus

The meeting is an activity with (almost) all teachers and no students. My trick was to extend this meeting to a second hour. I think what you are suggesting is basically the same. 

Volker Dirr

Be careful if you use max hours per day at the same time. Since if you extend it from 1 to 2 hours, even it is only a single hour, it might procedure gaps for teachers if you are using a max hours per day constraint at the same time.