Min hours daily for all teachers / for a teacher

Started by silvia, July 07, 2009, 10:27:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

silvia

Hello all,
I've encountered a problem when generating timetables and would like to suggest something.
Would it be possible to do one of these 2 things?
a) lower the weight of Min hours daily for teachers
or
b) lower the minimum and allow to use 1

The law in my country says that teachers must do a minimum of 2 hours a day. OK, so far, so good. The problem is that the law is different for teachers working only part time. If they do half of the weekly hours they don't have that minimum. Well, if I set the constraint of min 2 hours a day for all teachers at 100% weight, I don't get timetables because I have this teacher who is only doing 3 hours a week. Any possibility? any ideas?
Thanks

Liviu Lalescu

It is not possible to do your suggested changes. Min hours 1 means nothing. Min hours with <100% gives bad results. It is possible a trick: add 1 dummy activity (duration 1) for each such teacher :-).

Volker Dirr

It mean "nothing" because you ban a free day by that.
if you realy want min 1 hour to a teacher you can use this trick:
search an activity with many subactivities add/update the min n day constraint (maybe math is teached 4 hours in a week, already splited in 1 hour per day with a min n day constraint. So you have somethink like "min 4 working days with at least one hour". just an an other activity into this min n day constraint (of course with 100%), so you have min 1 hour at 5 days. i hope you understand the workaround.)

silvia

the problem with this is that free days are illegal here for teachers full time. I have a timetable with a full time teacher with 1 free day, so I should restrict min 2 hours a day (the law again), but if I do that, I get an impossible timetable because I have a part time teacher with only 3 classes (this teacher can have 2 free days). This means 1 class each day, but it can't be generated because there is a restriction of Min 2 hours a day for all teachers. I think I'm stuck, hahhahaha.

I'lln try with dummy activities, but will them appear in the teacher's timetable? She will be scared to death if she sees 6 classes  ;D

Volker Dirr

QuoteI'lln try with dummy activities, but will them appear in the teacher's timetable?

If the dummy activity constain only subject "---" (and of course the teacher name, but no students sets) you will not be able to see a difference between empty slot and dummy activity.

Liviu Lalescu

Quotethe problem with this is that free days are illegal here for teachers full time. I have a timetable with a full time teacher with 1 free day, so I should restrict min 2 hours a day (the law again), but if I do that, I get an impossible timetable because I have a part time teacher with only 3 classes (this teacher can have 2 free days). This means 1 class each day, but it can't be generated because there is a restriction of Min 2 hours a day for all teachers. I think I'm stuck, hahhahaha.

I'lln try with dummy activities, but will them appear in the teacher's timetable? She will be scared to death if she sees 6 classes  ;D

Teacher has 3 hours. Add only one dummy activity with duration 1 hour, no students.

Volker Dirr

i thought one more about the "min n hours per day" problem again, because we had a similar discuss at my school.

i think there is "just" a "min days per week for teacherS" constraint needed. doesn't solve that the problem in a good way?

so if you want a min n hours == 1 constraint, then you just add a "min n days per week" constraint.

if you want a min n hours ==2 constraint with allowed free days, then you add a "min n hours per day == 2" constraint.

if you want a min n hours == 2 constraint without free days, then you add a "min n hours per day ==2" and a "min n days per week == daysPerWeek" constraint.

hmm... i am currently just not sure how difficult to code that constraint.

Liviu Lalescu

#7
Quotei thought one more about the "min n hours per day" problem again, because we had a similar discuss at my school.

i think there is "just" a "min days per week for teacherS" constraint needed. doesn't solve that the problem in a good way?

so if you want a min n hours == 1 constraint, then you just add a "min n days per week" constraint.

if you want a min n hours ==2 constraint with allowed free days, then you add a "min n hours per day == 2" constraint.

if you want a min n hours == 2 constraint without free days, then you add a "min n hours per day ==2" and a "min n days per week == daysPerWeek" constraint.

hmm... i am currently just not sure how difficult to code that constraint.

It is easy to code. Just make the teacher(s) min hours daily non-intelligent. But I don't want to add alternative to min hours daily to have intelligent or non-intelligent, because people might obtain impossible timetables. I can tell you what to modify to make this. You'll have to compile your own FET.

I refer to latest snapshot 5.11.0:

In generate.cpp, lines: 7050, 7079, 7113, 7142. Make the tests already true (like add 1|| oldcondition).

This way, you can add min 1 hours daily for necessary teachers. You also need to modify the dialog of min n days, to accept 1 hour (because it only accepts >=2 values). Also, you need to modify in generate_pre.cpp, because FET complains if below 2 min hours.

Volker Dirr

no, i think you didn't understood my idea 100%, because with my variant it is also possible that a teacher still have a definied number of free days, while your solution mean a teacher will never have a free day.
(the number of free days is just 0 if you do a "min n day == daysPerWeek" constraint. but of course it should be also possible to use lower values.
so currently things like that are only possible by workarounds with min hours per day or min n days bewteen activities.
with a min n days per week you don't need that workarounds anymore.

Liviu Lalescu

It is not difficult, but I am not sure about performance. This constraint must be coupled with min hours daily, otherwise the algorithm might be too slow/not converge.

I'll think about it. Added in TODO.

Volker Dirr

maybe you can (also) try to coupled it with max days per week? but you know much better then me.

Liviu Lalescu

Quotemaybe you can (also) try to coupled it with max days per week? but you know much better then me.

No, max and min constraints are separated.

silvia

Quotei thought one more about the "min n hours per day" problem again, because we had a similar discuss at my school.

i think there is "just" a "min days per week for teacherS" constraint needed. doesn't solve that the problem in a good way?

so if you want a min n hours == 1 constraint, then you just add a "min n days per week" constraint.

if you want a min n hours ==2 constraint with allowed free days, then you add a "min n hours per day == 2" constraint.

if you want a min n hours == 2 constraint without free days, then you add a "min n hours per day ==2" and a "min n days per week == daysPerWeek" constraint.

hmm... i am currently just not sure how difficult to code that constraint.

That would be a solution, yes, at least for our school system. The reason why I suggested an additional  min 1 hour a day is because if a teacher gets one day with 1 hour, I can complete his timetable with surveillance (3 for each full time teacher). This way, that teacher will be within the law (working EVERY day and a minimum of 2 activities a day, and a maximum of 6 activities a day). There's no maximum of gaps a day.

We have a frame timetable of 7 hours on monday, tuesday and thursday, and 6 hours on wednesday and friday.

Of these 33 periods, each teacher must have 18 hours of class, 3 of surveillance and the rest (up to 24) of permanence (just being there available).

We try to give eache teacher a maximum of two 7th period (thanks for that modification). The rest of the timetable, counting lessons, surveillance and gaps (permanence) must not be less than 2 a day, not less than 5 days a week, no more than 6 classes a day, etc.

I hope this is understandable, because it's very late and I'm a bit sleepy :-)