Teachers' max span per day - not perfect

Started by Liviu Lalescu, February 02, 2017, 08:20:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

Quote from: rodolforg on February 02, 2017, 08:11:08 PM
Quote from: Liviu Lalescu on January 18, 2017, 06:21:07 PM
I see you would like to add a new constraint, teachers max span per day (so teachers do not stay at school for more than say 9 hours in a row). Your code might work, but unfortunately to add it in a perfect way is much more complicated; the generation must take care also of the interaction with other constraints.

Theses changes were based on a code you suggested in another forum topic. However, it does not work always, and I can't see why. Sometimes, after I reopen the generated .fet with the saved solution, I regenerate the timetable and FET yells the solution is impossible (because it disobeys the techer max span per day...)

If you need help, I can try. Tell me how to download your FET version (I don't have any skills with GIT). I am willing to compile from the start. Then email me your input file.

rodolforg

Quote from: Liviu Lalescu on February 02, 2017, 08:20:27 PM
If you need help, I can try. Tell me how to download your FET version (I don't have any skills with GIT). I am willing to compile from the start. Then email me your input file.
You can download the last source code of any branch from the BitBucket site itself.
There is a "navigation" panel In the left side. Click in "Downloads". Then select the "branches" tab and in the last table column there are links to download.

Please choose the "ifes" branch (it's my branch for development of my personal (and unpolished) stuff/case.

Or... here is the direct link ;) https://bitbucket.org/rodolforg/fet/get/ifes.tar.bz2
I'll send you my input file in private message here.

Liviu Lalescu

#2
Your code was not good, because the resulted timetables did not respect the constraint.

I am working now on it (I thought I coded it, but I discovered bugs in my code).

Liviu Lalescu

#3
OK, I got it working :)  Attached generate.cpp, to replace the corresponding file in your above mentioned repository variant of FET.

Please let me know.

rodolforg

Thank you, Liviu. It seems to work now.

However, my other personal constraint still doesn't work always. Maybe should I do similar what you did?

Liviu Lalescu

Tell me what should that constraint do, it is not that clear to me.

Yes, you could try. I will also try to help you.

rodolforg

Oh, I named it poorly.
It should be a constraints that avoids a short rest interval between two consecutive days. My school has classes in the morning, afternoon and night (different student sets, of course).
Some teachers have to work with some of the morning and night student sets. That constraint would prevent a teacher from teaching the last classes of a day and the first classes of the following day.
By law, every employee must have a minimum rest interval of 11 hours. At my school, it means "3 hours"/slots.

Liviu Lalescu

OK, the attached file seems to work. It was a bit harder this constraint. Please let me know.

PS: I made an assert(0) if the min rest time slots is too large, instead of writing an explanation.

rodolforg


Liviu Lalescu

I forgot something for your version (potential bug). Use the attached file in your version.

Liviu Lalescu

#10
These two new constraints (max span per day and min resting hours) are now implemented starting with the official FET-5.31.0 (released on 15 February 2017).