FET Forum

FET Support (English) => Get Help => Topic started by: y on November 03, 2012, 04:06:17 PM

Title: make a teacher leave early in one out of 2 days
Post by: y on November 03, 2012, 04:06:17 PM
I have the following problem in a 5 days - 7 hours timetable:

Teacher S has to leave early either on Thursday or Friday. This means that in one out of these two days he has to finish at the 4th hour the latest. How can I do that?

I tried with "a teacher works in a hour interval max days per week" with "interval start hour = 5", "interval end hour = end of day" and "max days per week = 4" but it doesn't always work. Obviously. How can I restrict this constraint only for Thursday and Friday?

Maybe it could be added as an extension in a future version.

Thank you!!!
Title: Re: make a teacher leave early in one out of 2 days
Post by: Liviu Lalescu on November 03, 2012, 04:49:58 PM
I think you can use constraint activities occupy max time slots from selection (maybe 5 .. end-of-day constraints suffice, if you are careful enough).
Title: Re: make a teacher leave early in one out of 2 days
Post by: y on November 03, 2012, 08:11:13 PM
Quote from: Liviu Lalescu on November 03, 2012, 04:49:58 PM
I think you can use constraint activities occupy max time slots from selection

I saw the constraint but I cannot figure out how to use it in my case. I want this particular teacher to end his day on the 4th hour, either on Thursday or Friday.

Quote(maybe 5 .. end-of-day constraints suffice, if you are careful enough).

No it does not, since it may give the result on a different day than Thursday or Friday. Or am I missing something?
Title: Re: make a teacher leave early in one out of 2 days
Post by: Liviu Lalescu on November 03, 2012, 08:27:47 PM
I thought linear number of constraints suffice. But I think again now and it seems you need quadruple number of constraints.

Say slots are Thu 5,6,7 and Fri 5,6,7. Add occupy max 1 slot from selection for each pair, starting with selection Thu 5 + Fri 5, then Thu 5 + Fri 6, ..., Thu 7 + Fri 7 (3x3=9 constraints). Should work, right? Because you cannot have valid any pair of hours from different days.

I was thinking of considering say Thu 5 and all Friday, then Thu 6 + aF, then Thu 7 + aF. But seems not to work.
Title: Re: make a teacher leave early in one out of 2 days
Post by: y on November 03, 2012, 08:41:51 PM
Quote from: Liviu Lalescu on November 03, 2012, 08:27:47 PM
Say slots are Thu 5,6,7 and Fri 5,6,7. Add occupy max 1 slot from selection for each pair, starting with selection Thu 5 + Fri 5, then Thu 5 + Fri 6, ..., Thu 7 + Fri 7 (3x3=9 constraints). Should work, right? Because you cannot have valid any pair of hours from different days.

Yes, I think it should work. I'll try this!

Thanks a lot!

Maybe, in a future version of FET, you could add an extension of the constraint "a teacher works in a hour interval max days per week", to allow to pick which days we want to apply this constraint, and not necessarily the whole week. It could be renamed to "a teacher works in a hour interval, max days from a days set" or something similar. Do you think something like this is feasible?
Title: Re: make a teacher leave early in one out of 2 days
Post by: Liviu Lalescu on November 04, 2012, 07:31:02 AM
It should be easy to add such a new constraint, but the name would be complicated (maybe: teachers/students interval max days per week from selection) and I am not sure how many would use it.

But I added our conversation in the TODO.
Title: Re: make a teacher leave early in one out of 2 days
Post by: y on November 04, 2012, 07:35:32 AM
Quote from: Liviu Lalescu on November 04, 2012, 07:31:02 AM
It should be easy to add such a new constraint, but the name would be complicated (maybe: teachers/students interval max days per week from selection) and I am not sure how many would use it.

But I added our conversation in the TODO.

Thank you Liviu, highly appreciated!!!