Weekly occurrence of max/min hours per day for a teacher

Started by Vangelis Karafillidis, April 13, 2016, 05:47:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vangelis Karafillidis

Weekly occurrence of max/min hours per day for a teacher
OR
How can we constrain the weekly occurrence of the minimum/maximum hours per day for a teacher?


The problem is described here:
http://lalescu.ro/liviu/fet/forum/index.php?topic=1534.msg9527#msg9527

In the above problem, a teacher (for example JOHN) has
21 hours per week
(5 days per week),


and is constrained by

min hours per day = 3

and
max hours per day = 5.

The combination 3+3+5+5+5 (or 3+5+3+5+5 etc) hours should be avoided. The combinations 3+4+4+5+5 and 4+4+4+4+5 are acceptable.
The indirect solution (Tips and Tricks  ;) ):

1) Create a pseudo-teacher PSEUDO_JOHN.

2) Create 3 pseudo-activities for this pseudo-teacher each with:
    split = 5, duration = 1, min days =1, weight = 100%

3) Create 1 pseudo-activity for this pseudo-teacher with:
    split = 4, duration = 1, min days =1, weight = 100%

4) Create 1 pseudo activity for this pseudo-teacher with:
    split = 2, duration = 1, min days = 1, weight = 100%

5) Go to "A set of activities occupies max time slots from a selection"
    Select all the above activities (JOHN's real activities and PSEUDO_JOHN's pseudo ones).
    Set number of slots = 21.

    In the generated timetable, just ignore PSEUDO_JOHN and his pseudo-activities!


pg788

We have a Teacher A with 14 hours weekly and one Teacher B with 16 hours weekly. Both are required to come on 5 days a week and can have maximum 5 hours daily and minimum 2 hours daily. However, the 2 hours should occur only on one day for Teacher B and maximum two days for Teacher A. How can I modify your trick for this requirement?

For Teacher A, do I create 2 pseudo activities with split 5 each, min days 1; one p.activity with split 3 and one p.activity with split 1? Similarly for Teacher B? Would this lead to too many gaps?

Vangelis Karafillidis

#2
If I understand correctly your problem correctly...

For Teacher A you should first create a pseudo teacher PSEUDO_TEACHER_A. If you need the two hour to occur exactly on one day, create the pseudo activities:
1) split = 5, duration = 1, min days = 1, 100%
2) the same as (1)
3) split = 4, duration =1, min days = 1, 100%
This would result min hours per day =2, max hours per day =3. Are you sure that the two hours should occur exactly on one day?


For Teacher B, you should first create the pseudo teacher PSEUDO_TEACHER_B. For this pseudo teacher, create the pseudo-activities:
1) split = 5, duration =1, min days = 1, 100%
2) the same as (1)
3) split = 3, duration = 1, min days = 1, 100%
4) the same as (3)
This would result in min hours per day = 2, max hours per day = 4. PLUS max days with two hours per day = 2. Are you sure that you need AT MOST two days with two hours?

For the gaps (per day or per week). Use the corresponding constraints for the REAL teachers A and B.
Please let me know the results!

pg788

Thanks for the suggestion!
The norms are the other way around: the teacher with 14 hours can have two hours on two days (but preferably one day), and the teacher with 16 hours can have it *at most* one day.

Vangelis Karafillidis

#4
Teacher A:
14 hours/week
max days with 2 hours per day = 2 (but preferably 1 day)
min hours daily = 2
max hours daily = 5

Teacher B:
16 hours/week
max days with 2 hours per day = 1
min hours daily = 2
max hours daily = 5

For Teacher A you should first create a pseudo teacher PSEUDO_TEACHER_A.
1) split = 5, duration = 1, min days = 1, 100%
2) the same as (1)
3) split = 3, duration =1, min days = 1, 100%
4) split = 1, duration = 1
5) for activities (3) and (4) create and insert an activity tag, for example: ACTIVITY_TAG
6) settings -> advanced -> enable activity tag max hours daily
7) constraint: max hours daily with an activity tag for a teacher. PSEUDO_TEACHER_A, ACTIVITY_TAG, max hours daily = 1, weight 99.9% (so the 3+1 activities would PREFERABLY but NOT NECESSARILY be placed in different days).
This should result in min hours per day = 2, max hours per day = 4 (preferably 3). PLUS max days with 2 hours per day = 2 (but preferably 1 day)


For Teacher B, you should first create the pseudo teacher PSEUDO_TEACHER_B. For this pseudo teacher, create the pseudo-activities:
1) split = 5, duration =1, min days = 1, 100%
2) the same as (1)
3) split = 4, duration = 1, min days = 1, 100%
4) split = 2, duration = 1, min days = 1, 0%  (to allow these two activities to be placed even on the same day).
This should result in min hours per day = 2, max hours per day = 5. PLUS max days with two hours daily = 1.

For the gaps (per day or per week). Use the corresponding constraints for the REAL teachers A and B.
Please let me know the results!


pg788