FET Forum

FET Support (English) => General Stuff => Topic started by: auriolar on April 15, 2018, 09:56:53 AM

Title: Does an individual constraint override a group one?
Post by: auriolar on April 15, 2018, 09:56:53 AM
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?
Title: Re: Does an individual constraint override a group one?
Post by: Volker Dirr on April 15, 2018, 10:38:47 AM
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.
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on April 15, 2018, 10:43:59 AM
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).
Title: Re: Does an individual constraint override a group one?
Post by: Volker Dirr on April 15, 2018, 10:51:20 AM
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)
Title: Re: Does an individual constraint override a group one?
Post by: 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
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on April 15, 2018, 02:30:46 PM
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.
Title: Re: Does an individual constraint override a group one?
Post by: rodolforg on April 15, 2018, 05:46:04 PM
Is there any reason to put an "All teachers*" 'except' field?
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on April 15, 2018, 05:53:45 PM
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?
Title: Re: Does an individual constraint override a group one?
Post by: Volker Dirr on April 15, 2018, 07:26:14 PM
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.
Title: Re: Does an individual constraint override a group one?
Post by: rodolforg on April 15, 2018, 07:49:29 PM
Exactly, Volker.

All teachers _but_ [select exceptions]
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on April 15, 2018, 08:59:37 PM
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.
Title: Re: Does an individual constraint override a group one?
Post by: rodolforg on April 16, 2018, 11:44:12 AM
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.
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on April 16, 2018, 11:48:28 AM
OK, I also noted this suggestion. Indeed, it might not be so hard. I'll think about it.
Title: Re: Does an individual constraint override a group one?
Post by: rodolforg on April 16, 2018, 01:07:16 PM
I think it's just a change in GeneratePre (besides GUI and file read/write stuff).
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on April 16, 2018, 01:59:08 PM
Yes, and number of conflicts computation. But there are many constraints for all teachers and all students.
Title: Re: Does an individual constraint override a group one?
Post by: rodolforg on April 16, 2018, 03:08:46 PM
Quote from: Liviu Lalescu on April 16, 2018, 01:59:08 PM
Yes, and number of conflicts computation.

What do you mean?
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on April 16, 2018, 03:47:06 PM
Quote from: rodolforg on April 16, 2018, 03:08:46 PM
Quote from: Liviu Lalescu on April 16, 2018, 01:59:08 PM
Yes, and number of conflicts computation.

What do you mean?

The number of soft conflicts if the constraint is broken.
Title: Re: Does an individual constraint override a group one?
Post by: rodolforg on April 16, 2018, 04:05:38 PM
Oh, right. The ::fitness() method.
Title: Re: Does an individual constraint override a group one?
Post by: pg788 on July 02, 2018, 01:49:42 PM
An "except" option will really be helpful!
Title: Re: Does an individual constraint override a group one?
Post by: Liviu Lalescu on July 02, 2018, 03:44:41 PM
Quote from: pg788 on July 02, 2018, 01:49:42 PM
An "except" option will really be helpful!

I added also your name to the TODO item #82 (an already existing item).