Author Topic: Teachers' max span per day - not perfect  (Read 193 times)

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 4810
  • FET author and forum moderator
    • View Profile
    • Homepage
Teachers' max span per day - not perfect
« on: February 02, 2017, 02:20:27 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

  • Level 1
  • *
  • Posts: 28
    • View Profile
Re: Teachers' max span per day - not perfect
« Reply #1 on: February 02, 2017, 06:40:59 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

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 4810
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Teachers' max span per day - not perfect
« Reply #2 on: February 03, 2017, 11:19:05 AM »
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).
« Last Edit: February 03, 2017, 12:47:35 PM by Liviu Lalescu »

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 4810
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Teachers' max span per day - not perfect
« Reply #3 on: February 03, 2017, 12:27:34 PM »
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.
« Last Edit: February 03, 2017, 12:52:15 PM by Liviu Lalescu »

rodolforg

  • Level 1
  • *
  • Posts: 28
    • View Profile
Re: Teachers' max span per day - not perfect
« Reply #4 on: February 03, 2017, 01:42:46 PM »
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

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 4810
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Teachers' max span per day - not perfect
« Reply #5 on: February 03, 2017, 01:44:26 PM »
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

  • Level 1
  • *
  • Posts: 28
    • View Profile
Re: Teachers' max span per day - not perfect
« Reply #6 on: February 04, 2017, 02:19:46 PM »
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

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 4810
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Teachers' max span per day - not perfect
« Reply #7 on: February 04, 2017, 04:34:57 PM »
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

  • Level 1
  • *
  • Posts: 28
    • View Profile
Re: Teachers' max span per day - not perfect
« Reply #8 on: February 04, 2017, 06:50:02 PM »
Thank you again!
Works like a charm  :)

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 4810
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Teachers' max span per day - not perfect
« Reply #9 on: February 07, 2017, 04:16:06 AM »
I forgot something for your version (potential bug). Use the attached file in your version.

Liviu Lalescu

  • Forum Administrator
  • Level 5
  • *****
  • Posts: 4810
  • FET author and forum moderator
    • View Profile
    • Homepage
Re: Teachers' max span per day - not perfect
« Reply #10 on: February 17, 2017, 09:44:03 AM »
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).
« Last Edit: February 17, 2017, 09:49:51 AM by Liviu Lalescu »