Teacher max days per week

Started by nl65, December 26, 2018, 01:48:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nl65

Need a refinement for this constraint which will specify preferred working days for the teacher.

For example teacher T is working 4 (out of 5) days a week, however her off day must be either Tuesday or Thursday.

Thanks!


Volker Dirr

#1
I highly don't recommend to add such a rule. There is normay never a reason for doing that.
If you think that you have got a reason, then think twice. In normal case it is "only" because of an other point. So should think about adding constaints for that other point.
You will run into trouble if you add your requested constraint without thinking about what you are doing.

Or in other words: Why don't you allow Monday, Wendsday or Friday?
Maybe you don't want to givr a free day at Wendsday, because there is always a teacher meeting in the afternoon.
But in fact you a reason like that is "wrong". Do you think it will be better if theachers have got only the 1st and 2nd hour on Wendsday and then they need to waint until the 8th hour start, just to visit the teacher meeting? that is even more worse then haveing free that day.
Maybe you don't want to allow Friday or Monday, because you don't want to give a long weekend. But why do you want to rile the other teachers. Even if you add such a rule: There will be teachers only teaching Friday 1st and 2nd hour. So they also have a longer weekend then others, you can't disallow that also. Similar to Monday last hours.

You can add your request by this:
Add an activity with the max allowed number of hours per day. Only the teacher, no student or (indirect) room. Maybe call the subject "free".
Add an activity preffered time for that activity. Allow only Tuesday or Thursday for this activity.
Use the advanged feature and order this activity first (not highly needed, but i bet generating will be faster with your dataset)
Of course you need to remove the max days constraint, since there is now a "free" activity at the free day.

This workaround is working finde with easy datasets. But like i said: i highly don't recommend it, since you will run into big trouble later if you add those activities.

nl65

The use case is very simple - each of our teachers lists her preference for off day(s).
So she would give us for example 2 possibilities for her off-day....
We can ignore, however we try to maximize "happiness" in our school :)


Volker Dirr

#3
I bet it isn't that simple. You asked this question already very early, even there are a lot of other much more needed constraints.
You will run into trouble if you think you will increase happyness with such a rule. You will increase it only for a single teacher, but a lot of other guys will suffer.

- you will suffer, if the table become impossible and/or if you need weeks to solve it.
- other techers will suffer, since only some part time teachers ask for rules like that while other part time teachers dare to ask for such "unneeded" rules like that
- all other teachers will suffer, because several of those rules are only possible if you increase the max number of gaps per week or max number of hours per day or ... - did you care about them already?!
- all students will suffer, if you don't care enough about their constraints.

The tables are mainly for the students! Add the constraints for students first! ask the students about their needs. You will wonder that there are a lot of good reasons for a lot of constraints (for example avoid a day with 1 hour english + 1 hour math + 1 hour foreign languarge + 1 hour physics + 1 hour chemisty + 1 hour biology while there is an other day with 2 hours sports + 2 hours art + 2 hours music; ...)

There are a lot of other constraints much more needed. You can maybe add such a rule at the very end. I don't know your dataset, but my dataset is already much too difficult much earlier. I even can't get close to point where a request like your rule can be added. think carefully about adding those rules. You won't increase happyness if you skip the other needed constraints; other teachers and students will just dislike you.

If the teacher ask for such a constraint and just have got the reason "happyness" i fear you need to ignore it. I can't imagine that you will be able to add all rules. I highly recommend to write down a list of all needed rules. Add the most needed one first! Don't start with "like to have".

nl65

I cannot disagree this is low-priority, soft constraint.

Liviu Lalescu

You can constrain a teacher to work on a certain day using a constraint activities occupy max time slots from selection. Read the constraint's help for instructions. Then you can force the teacher to work on Mo, We, and Fr.