Does an individual constraint override a group one?

Started by auriolar, April 15, 2018, 09:56:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

auriolar

Hello

It may be answered somewhere but I haven't found it.

If I set the constraint of "All Teachers..." and I want a less restrictive one for one teacher, wich one takes preference?

As an example  I want "Max hours daily for all teachers" to be 5, but there is a teacher with one day off so I want for him "Max hours daily for a teacher" to be 6.

It is possible or do I have to do one by one?

Volker Dirr

No. That is not possible.
You can only set max 6 for all and add max 5 to each single other one.

If cou have got a very large number of teachers you might think about using a trick:
Set only max 5 hours to all teachers.
Of course that is impossible for one teacher.
Now the trick:
delete one of his activities (or decrease the duration) and set the teacher and his students of that "deleted activity" as not available in a "special" slot. Now you generate a timetable and after it is finished you remove the not available times and place the detelete activity manually there, deactivtate the max hours per day constraint and "generate" the solution once again. You will get finial table in a second by that.

Liviu Lalescu

Yes, unfortunately the behavior is not the desired one. All the constraints are satisfied, meaning that also the constraint for all the teachers must be satisfied for that particular teacher (all the teachers will have max 5 hours daily).

I think the best is to add the individual constraints, or use tricks like Volker (but I am not sure if they are so useful or safe).

Volker Dirr

I used that trick myself some ago. In my case it was easy, since it was an activity that must be placed in the last 2 hours of a day. so i simply reduced the duration down to 1, set teachers and students not available and generated it. (i must admit i was to lazy to add the activity again. i just took my pen and wrote in into the free slot manualy)

auriolar

OK.
Thank you for the replies.

I'll have to do it by hand or create a simple editor to modify externaly the fet file for multiple teachers.
We work with more than 100 teachers and not all of them have the same conditions.

Thanks again

Liviu Lalescu

Quote from: auriolar on April 15, 2018, 02:27:26 PM
OK.
Thank you for the replies.

I'll have to do it by hand or create a simple editor to modify externaly the fet file for multiple teachers.
We work with more than 100 teachers and not all of them have the same conditions.

Thanks again

It is simple in both ways. From the dialog, press the Down Arrow then Enter to add multiple constraints in turn.

rodolforg

Is there any reason to put an "All teachers*" 'except' field?

Liviu Lalescu

Quote from: rodolforg on April 15, 2018, 05:46:04 PM
Is there any reason to put an "All teachers*" 'except' field?

Sorry, I don't understand this sentence. Is it addressed to me?

Volker Dirr

I think that he suggest to add into all "All X" constraints a list with the names that are NOT "in all".

So for example "All teachers max hours per day" -> There is a list with all teach names and you can select them.

rodolforg

Exactly, Volker.

All teachers _but_ [select exceptions]

Liviu Lalescu

It is already in the TODO, items #82 and #84. I added auriolar and rodolforg as upvoters in item #82. But it is complicated and it would use a not FET-like notation.

rodolforg

Quote from: Liviu Lalescu on April 15, 2018, 08:59:37 PM
it would use a not FET-like notation.

I don't think it needs to change the constraint names. Just add the 'exception' field.

Liviu Lalescu

OK, I also noted this suggestion. Indeed, it might not be so hard. I'll think about it.

rodolforg

I think it's just a change in GeneratePre (besides GUI and file read/write stuff).

Liviu Lalescu

Yes, and number of conflicts computation. But there are many constraints for all teachers and all students.