Teachers prefered free periods

Started by FM, June 03, 2020, 04:58:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FM

Hi, I am quite new at FET. For the last month I have been trying to learn the software and to generate timetables for the high school I am working at the moment. The aim is to use FET in the future and get rid of the software they used until now which is only working for windows and for some other reasons.

Ok, let's focus:

I have generated a timetable with the data for the current school year with FET. And I have quite succeed. Also enjoying the process )) All is fine, I made categories for multiple activities in same time slots, added rooms, control not full time teachers and make timetables with a max nº of week gaps of 2!!! which is something great.

But (there's always a but?), there is something I can't figure out. In the region where I live, almost every school use the same timetable generator software (comercial) and there is something they are very used to. They allow teachers to choose 4 time slots along the week prefered to be free, ordered from first to 4th option. For example to finish sooner a specific day or start one hour later another day. Obviously, not all the teachers at the same time can be free the same hour. So I have been thinking how to do it with the constraints FET offers.

My first try was using the not available teacher's periods, but the restriction must be 100% weight, and that doesn't math the needs.

So I decided to create 4 different subjects OFF1, OFF2, OFF3 and OFF4 and then I made the match the right period according to each teacher free preferences with the an activity has a prefered starting time, which allow me to give 90% to the OFF1 activities, 80% to the OFF2, 70% to the OFF3 and so on. The problem is that when FET couldn't allocate the activities at the right slot cause of other contraints and coincedences in teachers preferences, It allocates them in any slot, creating more real gaps in timetable. Then to avoid that, created a new tag for activities called FREE, and added a restriction to force these activities to be allocated at the 1st and last periods of each day of the week with 100% weight. The result, 10 hours FET trying :/  Oh, I forgot to mention that the max gaps per week is also set to value 2.

And I totally ran out of ideas. So I please ask you for help if anyone has a good neat idea to solve this issue and let add teachers free period references this way, before my old computer starts burning. I would really love to get it work, cause I really believe this software is good.

Thanks in advance.

Liviu Lalescu

#1
Hi,

I think there are two ways, see the attached files. liviu.fet has preferences order, liviu2.fet has no preferences order for the slots, only it will always be respected (I like better liviu2.fet). liviu.fet might waste time, because not all the preferences can be satisfied. liviu2.fet will work very nicely, ensuring a free slot out of 4, but you cannot have preferences over them.

Please let me know.

FM

#2
Hi, Liviu:

The first approach you suggested I can undestand. It's the clean and neat way to do it without twisting things as I did with creating extra activities. Well, I have added for only one teacher, and it is quite slower than without these restriction... so maybe you are right about time.

The second approach I still don't understand well. I will check if first one works and whether it does or not, I will have a look carefully at second option. I want to fully understand it too. But since you say you can't have preferences, this wouldn't match the need of teachers asking for a specific free hour, right?

Liviu Lalescu

Hello, FM,

That constraint, activities occupy max time slots from selection, is a very nice one: you select all the activities of teacher T, select 4 slots, and say that maximum 3 can be occupied out of these 4. So it is like you are telling the teacher: choose 4 preferred empty slots, and you will get one for sure out of them. The time is very optimized in this case, unlike preferred times with <100% weight.

You can also choose 3 slots and say max 2 occupied (to make the teacher happier, so he considers only the first 3 preferences for free slot).

If you add activities to teacher T, don't forget to update this constraint.

I would advise you to go with this activities occupy max time slots from selection approach.

FM

#4
Hi, Liviu:

After this your explanation, I think I do understand now what the second option does. But, is it neccessary to use the other time restrictions in the second file, the min number of days between activities set to 95%? and the prefered times for a set of activities from the first option? I mean, would it be enough to use the last restriction of this second file you sent me?

And also, would it be a lot time consuming to use this restriction twice over the same teacher, let's say choose 4 slots of the end of the day and you'll get one for sure and also do the same with another alike constraint for the beginning hours?

By the way, thank you for your attention... I really appreciate it.

Liviu Lalescu

#5
Quote from: FM on June 03, 2020, 07:33:16 PM
After this your explanation, I think I do understand now what the second option does. But, is it neccessary to use the other time restrictions in the second file, the min number of days between activities set to 95%? and the prefered times for a set of activities from the first option? I mean, would it be enough to use the last restriction of this second file you sent me?

Oh, only the constraint of type activities occupy max time slots from selection is needed.

Quote
And also, would it be a lot time consuming to use this restriction twice over the same teacher, let's say choose 4 slots of the end of the day and you'll get one for sure and also do the same with another alike constraint for the beginning hours?

Good idea! Certainly not a problem for FET.

If you want a teacher to have a free hour in one of the first (last) hours of the week, you can use one or two constraints of type teacher(s) interval max days per week. Interval = first hour or last hour, max per week = n_days_per_week - 1. This constraint is easier to add and maybe more efficient. But you don't have such a great control as in the constraint activities occupy max time slots from selection.

Quote
By the way, thank you for your attention... I really appreciate it.

You are welcome  :)  Please let me know if you succeed.

FM

Hello Liviu:

Thanks once again. As soon as I have a little more of time I will check all the options you suggested, including the last one. I am focusing right now in trying to make the timetable as compact as possible testing the min. hours per day for teachers and the max gaps. Just seeking the limits of hour timetable against generating time.

I was testing with the ordered preferences yesterday but the times of generation were going too high. So I decided to focus in making the timetable as compat as possible first and then will try the second and third options you told me about.

I will be posting the results here.

FM

Hi, again:

Liviu, I tried with the activities occupy max time slots from selection constraint. I attached 2 of them to each teacher with two occupied slots out of three in each of them, and I managed to generate the timetable in half an hour, more or less. That is really great news. Now I will try to make one hour of the two choices be the same, to increase the probability of being selected, but I am not sure if that will have the desired effect, what do you think about it?

Well, the effect is not exactly the same as what we were looking for for seting preferences from 1 to 4, which can be done with the prefered times for an activity with weight under 100% but this last option really seems very time demanding when generating the timetable, as you suggested. But it's a good solution anyway.

One last thing. I think I start to understand that as much as you use weights under 100% the process can become very long... am I right? Is it always better to use constraints with 100%?

Thank you very much, Liviu, for your help.


Liviu Lalescu

You are welcome!  :)

I am so tired because of last period work, I am not sure I estimate correctly, but if you make one hour of the two choices be the same, it will increase its probability of being selected, but it may be the only selected out of 5 slots.

Constraints with <100.0% weight lose time when they are not respected. Volker recommends only 100%.