Teacher Min Hours Per Day

Started by canhathuongnhau, January 16, 2017, 02:29:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

canhathuongnhau

Mr Liviu,
First thanks for all your support for me. I have a situation. Please help me!
In my timetable, I have five days with 10 hours per day. I used Teacher Min Hours Per  Day constraint. But I want only count min from first hour to fifth hour. I found "double ConstraintTeacherMinHoursDaily::fitness" at line 13778 in timeconsraint.cpp and "okteachersminhoursdaily = true" at line 8082 in generate.cpp. I understand source code in time timecontraint.cpp but not understand in generate.cpp. Can you help me to understand in generate.cpp more clearly and show me the code where i can edit to solved my problem? Thanks so much Mr Liviu!

Liviu Lalescu

In generate.cpp you need to modify in more places, in other constraints as well. This is complicated.

But I told you a simple solution: double the number of FET days per week to 10 and have only 5 hours per days. Then you can use constraint teachers min hours daily for a real half day, like in the Morocco FET custom version.

canhathuongnhau

Mr Liviu, Thanks for reply. My timetable a day has 10 hours. I want to have min hours daily(10 hours) and have min hours for session (session has 5 hours). I know to do that is complicated but I want to do that. Please help me to do that!
Thanks so much!

Liviu Lalescu

I am sorry, but I cannot explain better than giving the source.

Search in the sources for the string "teachersMinHoursDailyMinHours" and do it similar, but only for the first part of the day. You might need to compute variables similar to teachersDayNGaps and teachersDayNHours or similar.

Or you could use the negation of activities occupy max time slots from selection, adding 5 constraints for each teacher (one for each day).

Liviu Lalescu

I will try to help you, but you need to read the sources and see how I did, and try to imitate.

teachersDayNHours and teachersDayNGaps represent the number of current number of hours (active hours) and gaps for a day. I guess you need to define and calculate these for only half a day. The check is done in generate.cpp in two stages, preliminary (newTeachersDay...) and current (tchDay...). At each step we check that the number of remaining activities is enough for filling a timetable respecting the min hours daily.

canhathuongnhau

Mr Liviu, Thanks so much. I'll read code and do follow your guide. Love you :D