FET Forum

FET Support (English) => Get Help => Topic started by: canhathuongnhau on January 16, 2017, 02:29:04 AM

Title: Teacher Min Hours Per Day
Post by: canhathuongnhau on January 16, 2017, 02:29:04 AM
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!
Title: Re: Teacher Min Hours Per Day
Post by: Liviu Lalescu on January 16, 2017, 09:21:43 AM
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.
Title: Re: Teacher Min Hours Per Day
Post by: canhathuongnhau on January 16, 2017, 09:42:04 AM
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!
Title: Re: Teacher Min Hours Per Day
Post by: Liviu Lalescu on January 16, 2017, 10:10:29 AM
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).
Title: Re: Teacher Min Hours Per Day
Post by: Liviu Lalescu on January 16, 2017, 02:57:44 PM
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.
Title: Re: Teacher Min Hours Per Day
Post by: canhathuongnhau on January 17, 2017, 06:16:22 AM
Mr Liviu, Thanks so much. I'll read code and do follow your guide. Love you :D