FET Forum

FET Support (English) => Get Help => Topic started by: alex on January 01, 2016, 08:16:49 AM

Title: Constraints with necessary 100% weight
Post by: alex on January 01, 2016, 08:16:49 AM
Hello! Happy New Year!

Liviu, there are some FET constraints (such as "min hours daily for a teacher") with necessary constraint weight 100%. I think that for certain circumstances it would be useful if I could input a weight of (let's say) 95% for 3 hours (for min hours daily) and 100% weight for 2 hours (for the same teacher), so FET should search for solutions for min hours daily=3 and if these solutions are not possible, it would search for solutions for min hours daily 2. Does FET lack such an option due to an inherent (coding) restriction? If not, it might be useful to allow other (than 100%) percentages for such constraints.

Thanks!
Title: Re: Constraints with necessary 100% weight
Post by: Liviu Lalescu on January 01, 2016, 08:31:11 AM
Thank you! To you, too!

I would not like to restrict these weights to 100%, because they would be useful, but restricting them to 100% is needed in the generation. To be effective, the weights would need to be something like 99.999% (otherwise the solutions would break the constraint too much), but then the timetabling process would be too slow.
Title: Re: Constraints with necessary 100% weight
Post by: alex on January 01, 2016, 08:33:16 AM
OK! Thanks a lot!
Title: Re: Constraints with necessary 100% weight
Post by: alex on January 01, 2016, 01:49:46 PM
Quote from: Liviu Lalescu on January 01, 2016, 08:31:11 AM
Thank you! To you, too!

I would not like to restrict these weights to 100%, because they would be useful, but restricting them to 100% is needed in the generation. To be effective, the weights would need to be something like 99.999% (otherwise the solutions would break the constraint too much), but then the timetabling process would be too slow.

Liviu, it might be a good idea, if you allowed the less than 100% weight just giving a warning (or adding an "advanced" tab, or "not recommended" tab, etc...), that the timetabling process would become really slow. What do you think? Maybe this would be useful. To give one more option for FET, which could be used under strange circumstances. For example, if one of the teachers has let's say 15 hours per week (5 days per week), of course it would be far better if I could create a timetable with 3 hours per day (5 days a week), BUT if this is too difficult, it would be useful to constrain the "min hours daily"=3 with 98% and constrain again "min hours daily"=2 with 100%. So, FET would search for such solutions. Thanks!
Title: Re: Constraints with necessary 100% weight
Post by: Liviu Lalescu on January 01, 2016, 03:36:05 PM
I am sorry, but It is more difficult than this. When I designed the constraints min hours daily (for students) I tried weights under 100% and things were bad. If I made weight 99.99% or something like that, it was not respected for more days. If I made the weight greater, it was respected always. In other words, it is impossible to tune the weight for a single unrespected day (even if having the min hours daily 2 100%).

Min hours daily is very different in the manner of working than max hours daily. This is the algorithm.

I can tell you that you can constrain 100% min 3 hours on a special chosen day, using constraint activities occupy max time slots from selection (read the help for that constraint and ask me if you don't know how). So you might select 4 days manually and force the teacher to have min 3 hours on these days.
Title: Re: Constraints with necessary 100% weight
Post by: Volker Dirr on January 01, 2016, 03:56:11 PM
Quote from: alex on January 01, 2016, 01:49:46 PM
For example, if one of the teachers has let's say 15 hours per week (5 days per week), of course it would be far better if I could create a timetable with 3 hours per day (5 days a week), BUT if this is too difficult, it would be useful to constrain the "min hours daily"=3 with 98% and constrain again "min hours daily"=2 with 100%. So, FET would search for such solutions. Thanks!

But there is an other easy trick possible:
Set min hours daily = 3 and give that teacher a single pseudo activity. (of course you maybe need to decrease the number of max gaps of that teacher then.)
Title: Re: Constraints with necessary 100% weight
Post by: alex on January 01, 2016, 05:35:30 PM
Quote from: Liviu Lalescu on January 01, 2016, 03:36:05 PM
I am sorry, but It is more difficult than this. When I designed the constraints min hours daily (for students) I tried weights under 100% and things were bad. If I made weight 99.99% or something like that, it was not respected for more days. If I made the weight greater, it was respected always. In other words, it is impossible to tune the weight for a single unrespected day (even if having the min hours daily 2 100%).

Min hours daily is very different in the manner of working than max hours daily. This is the algorithm.

I can tell you that you can constrain 100% min 3 hours on a special chosen day, using constraint activities occupy max time slots from selection (read the help for that constraint and ask me if you don't know how). So you might select 4 days manually and force the teacher to have min 3 hours on these days.

OK Liviu! I see! Thanks!
Title: Re: Constraints with necessary 100% weight
Post by: alex on January 01, 2016, 05:38:09 PM
Quote from: Volker Dirr on January 01, 2016, 03:56:11 PM
Quote from: alex on January 01, 2016, 01:49:46 PM
For example, if one of the teachers has let's say 15 hours per week (5 days per week), of course it would be far better if I could create a timetable with 3 hours per day (5 days a week), BUT if this is too difficult, it would be useful to constrain the "min hours daily"=3 with 98% and constrain again "min hours daily"=2 with 100%. So, FET would search for such solutions. Thanks!

But there is an other easy trick possible:
Set min hours daily = 3 and give that teacher a single pseudo activity. (of course you maybe need to decrease the number of max gaps of that teacher then.)

Thank you Volker! I use the pseudo-activities for some other reasons. I think (I'm not sure... I think) that they slow down the solving process... But, I'll try your trick.
Title: Re: Constraints with necessary 100% weight
Post by: Liviu Lalescu on January 02, 2016, 07:08:44 PM
If the teacher has 15 hours per 5 days week, why can't you use max 3 hours daily 99% or similar weight, alongside with min 2 hours daily 100% and max 4 hours daily 100%? You can combine constraints.

PS: Dummy activities do not slow down the process.

Title: Re: Constraints with necessary 100% weight
Post by: alex on January 03, 2016, 10:01:48 AM
Quote from: Liviu Lalescu on January 02, 2016, 07:08:44 PM
If the teacher has 15 hours per 5 days week, why can't you use max 3 hours daily 99% or similar weight, alongside with min 2 hours daily 100% and max 4 hours daily 100%? You can combine constraints.

PS: Dummy activities do not slow down the process.

Thank you Liviu! Your answer is really interesting!!!