FET Forum

FET Support (English) => Get Help => Topic started by: pervezshaikh on April 14, 2018, 03:34:55 AM

Title: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 14, 2018, 03:34:55 AM
I used the subjected constraint for a teacher (Mr. S Bhanbhan). But FET ignores the constraint. Am I doing certain mistake?
Edited note: I am not able to upload <Even_Semester_CED_data_and_timetable.fet> file as its size is 540 kB.
Title: Re: A teacher works in an hourly interval max days per week
Post by: Volker Dirr on April 14, 2018, 08:35:49 AM
please compress (zip) the final solution file (from the fet-results folder). (So do a right click and press sent to compressed file).
Title: Re: A teacher works in an hourly interval max days per week
Post by: Volker Dirr on April 14, 2018, 08:42:39 AM
Please also exmplain a bit more detailed about what constraint you are exactly talking. i can't see it in your dataset.
Title: Re: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 14, 2018, 12:00:59 PM
Read the subject again. It will explain you the constraint. However, I used <A teacher's not available times> constraint alternatively, and got my results. (I think it is duplication of constraints.) Here is the zipped file attached.
Title: Re: A teacher works in an hourly interval max days per week
Post by: Volker Dirr on April 14, 2018, 12:30:06 PM
I generated the timetable. All is fine. I can't see an incorrect constraint.

i guess you are talking about
FET -> Data -> TIme constraints -> activities -> a set of activities have prefered time slots -> constraint numer 9 and 10.
So you talk about the constraints with activity tag "(*)" or "(T)", don't you?

You allowed that those constraints might be broken, since you set weight with less then 100%. You must increase weight up to 100%, only than the constraints won't be broken.
Title: Re: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 14, 2018, 06:02:32 PM
Volker!
No. I am talking about the following constraint:
FET->Data->Time constraints->Teachers->A teacher works in an hourly interval max days per week
The concerned box will show you:
Time constraint
A teacher respects working in an hourly interval a maximum number of days per week
Weight (percentage)=100%
Teacher=Mr. S Bhanbhan
Interval start hour=09:00-10:00
Interval end hour=11:00-12:00
Maximum days per week=5

but the results are out of bound. His six hours are not respected out of 12.
I hope you understand now. Earlier I have told that I did it alternatively.
Title: Re: A teacher works in an hourly interval max days per week
Post by: Volker Dirr on April 14, 2018, 08:14:04 PM
yes, that constraint is respected. it is fine. it isn't broken. i fear you missunderstood that constraint. he is wokring max 5 days in that limit. he is allowed to work in other periods.

Liviu: looks like users missunderstood this constraint. i suggest to set the max days per week only to (max days per week -1), because if you set it to max days per week the constraint is useless and will always be respected.
Title: Re: A teacher works in an hourly interval max days per week
Post by: Liviu Lalescu on April 14, 2018, 08:24:01 PM
Quote from: Volker Dirr on April 14, 2018, 08:14:04 PM
Liviu: looks like users missunderstood this constraint. i suggest to set the max days per week only to (max days per week -1), because if you set it to max days per week the constraint is useless and will always be respected.

Maybe. I'll think about this. We have constraints like min days between activities which use your style, and constraints like max hours per day, which use my style.

Let me know if you want it in the TODO.
Title: Re: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 15, 2018, 12:39:17 AM
I am not pointing towards max days. read carefully
Quote from: pervezshaikh on April 14, 2018, 06:02:32 PM
Interval start hour=09:00-10:00
Interval end hour=11:00-12:00

the start and end times are violated 6/12 times.
Title: Re: A teacher works in an hourly interval max days per week
Post by: rodolforg on April 15, 2018, 01:16:26 AM
Quote from: pervezshaikh on April 15, 2018, 12:39:17 AM
I am not pointing towards max days. read carefully
Quote from: pervezshaikh on April 14, 2018, 06:02:32 PM
Interval start hour=09:00-10:00
Interval end hour=11:00-12:00

the start and end times are violated 6/12 times.

The mentioned constraint states:
The teacher can only work [5] days in this time range [9:00~12:00]

In your case, the week has 5 days, so the teacher can teach every week day.
Title: Re: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 15, 2018, 03:15:13 AM
rodolforg!

But the FET is not respecting  time range [9:00~12:00]!
Title: Re: A teacher works in an hourly interval max days per week
Post by: rodolforg on April 15, 2018, 03:55:18 AM
Yes, it is.

I really believe you misunderstood the constraint.
There can be any number of activities from 9:00-10:00 until 11:00-12:00, as long as they do not use more than 5 days of the week (according to your parameters).

What activities exactly would have broken this constraint?
Title: Re: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 15, 2018, 04:09:58 AM
rodolforg!
Quote from: rodolforg on April 15, 2018, 03:55:18 AM
What activities exactly would have broken this constraint?

Monday: 14-15
Tuesday: 12-13 and 13-14
Wednesday: 14-15 and 13-14
Thursday: 8-9
Title: Re: A teacher works in an hourly interval max days per week
Post by: rodolforg on April 15, 2018, 04:17:46 AM
OK. Now I get what it though the constraint means.

This constraint name is:
A teacher works in an hourly interval max days per week   - The focus is to limit the number of busy days in that time range

not:
A teacher only works in an hourly interval

You should use instead:
Teacher Not Available Times

And mark when teacher cannot work (each hour/period specifically) ;)
Title: Re: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 15, 2018, 06:36:58 AM
 rodolforg!
OK. Then explain me the following also.
There is a constraint:
FET->Data->Time constraints->Teachers->Min days per week for a teacher

How this constraint is different from the constrain under discussion?
Title: Re: A teacher works in an hourly interval max days per week
Post by: rodolforg on April 15, 2018, 07:23:07 AM
> Min days per week for a teacher

The teacher must work X days at a minimum.

Suppose a week has 5 days: Mo, Tu, We, Th, Fr.
Teacher has 8 activities.
That constraint is set to 3 minimum days.

His activities can be placed as:
Mo: 2 activities no matter at what time
Tu:  2 activities no matter at what time
We:  2 activities no matter at what time
Th:  2 activities no matter at what time
Fri: none

(4 work days)

or

Mo: 5 activities no matter at what time
Tu:  none
We:  none
Th:  2 activities no matter at what time
Fri: 1 activity no matter at what time

(3 work days)

or

Mo: 3 activities no matter at what time
Tu:  1 activity no matter at what time
We:  1 activity no matter at what time
Th:  2 activities no matter at what time
Fri: 1 activity no matter at what time

(5 work days)

but NOT this case:

Mo: 4 activities no matter at what time
Tu:  none
We:  none
Th:  4 activities no matter at what time
Fri: none

(< 3 work days)




The other constraint is completely unrelated:
Start time: 9h
End Time: 11h
Max days: 3
Number of activities assigned to teacher: 8

This is a valid solution:
Mo [9h, 10h, 11h]: 2 activities
Tu [9h, 10h, 11h]:  none
Tu (rest of day) : 1 activity
We [9h, 10h, 11h]:  none
We (rest of day) : 1 activity
Th [9h, 10h, 11h]:  4 activities
Fri [9h, 10h, 11h]: none

working days: 4 (Mo, Tu, We and Th)
working at 9~11h: 2 days only (Mo and Th)

this is NOT a solution:
Mo [9h, 10h, 11h]: 2 activities
Tu [9h, 10h, 11h]:  none
We [9h, 10h, 11h]:  1 activity
We (rest of day) : 1 activity
Th [9h, 10h, 11h]:  2 activities
Fri [9h, 10h, 11h]: 1 activity
Fri (rest of day): 1 activity

working days: 4 (Mo, We, Th and Fri)
working at 9~11h: 4 (Mo, We, Th, Fri) > 3 allowed days in 9h~11h timeslot window
Title: Re: A teacher works in an hourly interval max days per week
Post by: pervezshaikh on April 15, 2018, 07:40:00 AM
rodolforg!
Thank you for such long and comprehensive explanation. Here I sum up my misconception or in adequate explanation in the FET.
I thought about the teacher: Max days (available)
FET schedules the teacher: Max days (working)

Thanks once again.
Title: Re: A teacher works in an hourly interval max days per week
Post by: Benahmed Abdelkrim on April 15, 2018, 07:40:43 AM
Quote from: pervezshaikh on April 15, 2018, 06:36:58 AM
rodolforg!
OK. Then explain me the following also.
There is a constraint:
FET->Data->Time constraints->Teachers->Min days per week for a teacher

How this constraint is different from the constrain under discussion?

if you set min days = 3 it means that the teacher must not have less than 3 working days a week. that is, he can have 3 days, 4, days, or more. but it is not allowed to have 2 days, or less.
Title: Re: A teacher works in an hourly interval max days per week
Post by: Volker Dirr on April 15, 2018, 09:12:15 AM
Quote from: Liviu Lalescu on April 14, 2018, 08:24:01 PM
Quote from: Volker Dirr on April 14, 2018, 08:14:04 PM
Liviu: looks like users missunderstood this constraint. i suggest to set the max days per week only to (max days per week -1), because if you set it to max days per week the constraint is useless and will always be respected.

Maybe. I'll think about this. We have constraints like min days between activities which use your style, and constraints like max hours per day, which use my style.

Let me know if you want it in the TODO.

I think i prefer the strict variant. So allow only (max days üer week -1) since the other is useless. So also max hours per day should have only a maximum of (hours per day - 1).
I suggest to add it into the TODO.
Title: Re: A teacher works in an hourly interval max days per week
Post by: Liviu Lalescu on April 15, 2018, 10:38:00 AM
OK, added.