[POSSIBLY SOLVED in FET-6.17.0 on 16 February 2024] Alternative breaks

Started by Liviu Lalescu, September 02, 2020, 04:29:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

These "alternative" breaks were suggested by more users.

I invite all users to participate in this topic.

For instance, the teachers should have on each day a one hour break, either at hour 5 or at hour 6.

I have an idea how to do this: we could consider a matrix for the constraint, and each day should have either hours void, or X, or Y. If an hour with X is occupied on a day, all Y hours on the same day are free in the final timetable, and viceversa, if an hour with Y is occupied on a day, all X hours on the same day are free in the final timetable.

For instance, in our above example, on each day we select with X hour 5 and with Y hour 6.

There is a check box, alternative breaks are counted as gaps or not, default being not counted as gaps.

Or should I consider the simpler case, each day should have two Xs, and at most one should be occupied?

Everybody, please let me know your opinion.

Volker Dirr

I don't know how to solve this problem best.

Just two more ideas about it:

a) i think your second variant is better, since it should also work fine with 3 hours. Very large schools with small kitchen might use them.

b) isn't this sometimes much too strict? Let's assume you want to use 2 hours only and there is a teacher with only 2 hours on one day. Isn't that constraint much too strict for that teacher? If he teachers only 2 hours that day it isn't critical that he do that in exactly that two hours. No need to keep one of them free.

Liviu Lalescu

Volker, nobody requested 3 hours alternative or to care about (b). It is a bit complicated to care about 3 hours alternative.

I think the best might be to add the simple case 2 hours alternative. So each day has 0 or 2 hours marked with X.

But if you really insist, I'll think of max 3 X's.

I am wondering about the gaps. If the user selects two slots with X, and says that the break should not count as a gap. Then if both X-marked slots remain free by chance, I count 0 gaps, even if in fact there is 2-1=1 gap?

Volker Dirr

I don't insist on that, but just because a few guys asked for 2 hours it doesn't mean they all need only 2.
I just checked lunch times at an university.

As you can see the times are more than 2 hours only. (Hot meal from 11.30 - 14.00. Cold meal from 10.00 - 14.00 ).

So it is maybe clever to think about that right now and not waiting for someone that ask for it and then just answering "Sadly to late to change that now".

So is it is not (too) difficult, i suggest larger times. Is it is difficult: do it with only 2 hours.

But i still struggle a bit about problem b). Sadly i don't have a good idea for that right now. Looks like the other guys didn't saw that problem right now. Maybe it is also only a minor problem for them. I can't answer it. Only the other guys can tell us. Sadly they didn't told us right now.

Liviu Lalescu

OK, Volker, you are right, and also see TODO item #370.

I will try to do this: a whole day, and the user can select with X any number of slots. At least one should remain free. None of these slots, if free, will count as a gap.

Liviu Lalescu

I thought about this. The solution which I hope will satisfy everything:

Add these new types of constraints:

1) Constraint teacher(s)/students (set) alternative not available daily time slot. The user can select at least 2 slots from a day. Please tell me if you think of a better word than "alternative". The gaps are counted.

2) Constraint  teacher(s)/students (set) do not count gaps in selected slots - so that TODO item #46 by ßingen is addressed. And the above constraint as well.

Please let me know what you think.

Volker Dirr

maybe moveable, mobile, agile, flexible, loose, ... But my English is too bad. I hope a native speaker will answer.

Liviu Lalescu

Constraint teacher(s)/students (set) do not count gaps in selected slots - hmmm, it is not really a constraint. Is it fair to add it like this?

Volker Dirr

hmm... in fact it is not a constraint. So it is only an option/checkbox in the other constraints?

Liviu Lalescu

I just saw how many users suggested this very useful constraint. There are many posts on the forum. Like: https://lalescu.ro/liviu/fet/forum/index.php?topic=4533.0

I thought much about it. These are the latest conclusions:

Add constraints teacher(s)/students (set) random daily continuous break in interval.

Interval: [start, end).

Min duration of the break: 0, 1, ..., interval_length-1.

Why 0 allowed? To address TODO item #46 (a teacher should not count gaps in a certain interval).

Gaps in this interval won't be counted for the affected teacher(s)/students (set). Empty spaces in this interval will be written with -I- in the timetables.

Please let me know what you think.

Volker Dirr

yes. Also with 3 hours :-)

Just to be sure i understand correct:
So this might happen (i think it is fine).

Maybe intervall is from hour 4 to 7.
Min duration of break is 1.

The teacher get this:
hour 4: an activity
hour 5: NO activity
hour 6: NO activity
hour 7: an activity

So hour 5 is marked with -I- and not counted as gap.
And hour 6 is marked with -x- and counted as gap.
(Of course it also might mark hour 6 with -I- but hour 5 with -x-).

Or will be both makred with -I-. I just wonder a bit, since you wrote "min duration". So a user migth also expect both marked with -I- (but i think hat is maybe not always what the user what.). So it is maybe "makred hours as break" instead of "min duration"? But i am not sure.

Liviu Lalescu

Yes, you were right with 3 hours  :)

Hours 5 and 6 are marked with -I- and not counted as gaps (I think you meant one with -I- and one with ---).

All the hours in the interval are marked with -I- unless there is a real activity, and not counted as gaps. Unfortunately, I cannot do it in another way.

Volker Dirr

oh.. yes, i mean ---.

hmm... if the intervall is 2 or 3 it doesn't matter.
i am not sure about guys with intervall 4 or higher. they might prefer the other way. but i am not sure.

i just came up with an idea about problem b). Maybe it is possible to add an option/checkbox "only if he/she/they has/have at least x hours at that day".

Liviu Lalescu

I think problem (b) does not really appear in practice. It is complicating an already very complicated situation (for the user and for the programmer).

Hmm, I need to think of the feasibility/realization of my proposal... not to consider gaps in this interval is something special for the algorithm and I am not sure is possible.

Volker Dirr

hmm... isn't that easy for programmer , since you only need to start that constraint only with an simple if(hours_that_day > X)? So it is not needed to modify the algorithm at any other point?!