FET Forum

FET Support (English) => Get Help => Topic started by: Cyrus on December 22, 2019, 03:43:27 PM

Title: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 22, 2019, 03:43:27 PM
How can one configure get to ensure teachers can never have 4 sessions consecutive with a break between (2-2) such that whenever a teacher taughts  2 sessions followed by a break,one can only have one more and not two.
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 22, 2019, 03:57:13 PM
I think this: for each teacher, add n_days constraints activities occupy max time slots from selection, selected the 4 slots, max occupied = 3.

A lot of constraints to add, unfortunately.
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 26, 2019, 05:57:46 PM
For teachers taking sciences,they do have 2 hours consecutive for practicals.I have noticed there are likelihood of a teacher having those sessions for 4 days every morning which I don't think is OK.How can one make sure that those teachers will only have a maximum of 2 doubles a week?
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 26, 2019, 06:12:49 PM
Do you mean "will only have a maximum of 2 doubles a morning"?

I think the same constraint type applies: for each teacher, add a constraint activities occupy max time slots from selection. Activities = the practical activities of that teacher, selected slots = morning all days, max occupied = 4.

Please let me know.
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 29, 2019, 05:53:52 PM
The doubles worked.Thanks
For the other,I didn't try since its quite tedious to do give the constraint to all teachers  on daily basis.Wish there was a way of having like max time slots from selection for all teachers.That would be better
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 29, 2019, 06:22:39 PM
I added this in the TODO, but I don't like it, since it is a particularization.
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 29, 2019, 06:40:27 PM
OK.I have realized with addition of constraints for teacher handling sciences,the  generating is very slow to an extent of having 479 activities taking more than an hour.I may opt to be generating multiple timetables and then I select the best.I believe I can't miss a favourable one from the multiples
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 29, 2019, 06:46:27 PM
The occupy max constraints are working OK, they in themselves do not slow down the generation, I believe only the timetable is much more difficult with these requirements. I think you won't get good timetables from multiple. Maybe you could put occupied max 6 instead of 4 per morning, for all or for the more relaxed teachers.

Could you please send me this file? If not private, attach it here. If private, by email.
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 29, 2019, 07:06:38 PM
Have a look at it.That only have constraints for double sessions
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 29, 2019, 07:14:02 PM
You have realised I haven't given teachers time not available meaning the speed should be good but its kind of slow
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 29, 2019, 07:35:24 PM
I just downloaded the file and will look at it. Do you mean that you still need to add some constraints (teachers not available) and they will make the generation even slower or even impossible?
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 29, 2019, 07:47:27 PM
One minor thing: you don't need to define a students' year 2020, a year is just a students set. But this does not matter.

But the mistake (I think): the last constraints (occupy max) shouldn't be with max occupied 4 slots (hours) instead of only 2? So in the morning there can be 2 activities with duration 2 each? Please let me know asap (also, the last 6 out of the 12 constraints had other slots selected).

Also, I saw some activity tag max 1 hours daily. Shouldn't you modify the respective min days between activities constraints to have 100% weight instead of 95? (you can modify all the constraints with a few clicks, in the min days between activities constraints dialogs or in the Advanced > Spread the activities evenly over the week).

I will now generate on your file.
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 29, 2019, 09:49:18 PM
I think I found your problem. It seems that teacher 13 cannot have max 6 hours daily. If you want to know how I found this: I kept on deactivating constraints. I deactivated teachers max 6 hours daily and it solved. Then I made it with weight 99% and it solved without respecting for teacher 13.

I attach you archived two files and three solutions (two to the second file). You can neglect the warning that they are generated by a newer FET - it is the future version number on my hard disk, but the format is identical. They solve acceptably fast (~4..12 minutes). The solution named "...solution2.fet" is the best, only has 7 hours for teacher 13 on a day, but 0 other conflicts.

I recommend you the second file, with max hours daily 100% for every teacher without 13. The first file, with 99.9% max hours daily for all teachers, is theoretically not so efficient.
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 30, 2019, 03:06:19 AM
It worked.Thanks
How did you know teacher 13 can't have a maximum of 6 hours daily and the teacher only have 21 sessions?
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Liviu Lalescu on December 30, 2019, 07:39:23 AM
I wrote in my answer above in the first paragraph how I found that teacher 13 cannot have max 6 hours daily. I did not know the teacher only has 21 sessions (why does this matter?)
Title: Re: Avoiding 4 sessions consecutive for teachers even when there is a break
Post by: Cyrus on December 30, 2019, 07:48:12 AM
Kindoff thought since we have 9 hours daily apart from Tuesday where we have 10,6  would be minimum hours but I will reconsider that