FET Forum

FET Development => Suggestions => Topic started by: Liviu Lalescu on September 02, 2020, 04:29:54 PM

Title: [POSSIBLY SOLVED in FET-6.17.0 on 16 February 2024] Alternative breaks
Post by: Liviu Lalescu on September 02, 2020, 04:29:54 PM
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.
Title: Re: Alternative breaks
Post by: Volker Dirr on September 02, 2020, 05:16:44 PM
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.
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 02, 2020, 07:10:48 PM
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?
Title: Re: Alternative breaks
Post by: Volker Dirr on September 02, 2020, 09:33:28 PM
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.
See:
http://www.studierendenwerk-bielefeld.de/essen-trinken/essen-und-trinken-in-mensen/bielefeld/mensa-gebaeude-x.html

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.
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 03, 2020, 10:38:26 AM
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.
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 03, 2020, 11:50:33 AM
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.
Title: Re: Alternative breaks
Post by: Volker Dirr on September 03, 2020, 05:15:57 PM
maybe moveable, mobile, agile, flexible, loose, ... But my English is too bad. I hope a native speaker will answer.
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 03, 2020, 08:29:37 PM
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?
Title: Re: Alternative breaks
Post by: Volker Dirr on September 03, 2020, 09:08:46 PM
hmm... in fact it is not a constraint. So it is only an option/checkbox in the other constraints?
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 04, 2020, 03:58:53 PM
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.
Title: Re: Alternative breaks
Post by: Volker Dirr on September 04, 2020, 06:44:04 PM
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.
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 04, 2020, 06:50:45 PM
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.
Title: Re: Alternative breaks
Post by: Volker Dirr on September 04, 2020, 06:59:10 PM
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".
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 04, 2020, 07:05:58 PM
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.
Title: Re: Alternative breaks
Post by: Volker Dirr on September 04, 2020, 07:44:10 PM
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?!
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 04, 2020, 07:51:10 PM
Unfortunately, it seems not like this. I will think about it, but seems impossible.

Oh, it is easy, indeed. But it complicates very much the operation/interface for the user, which is already very complicated.
Title: Re: Alternative breaks
Post by: Liviu Lalescu on September 16, 2020, 05:23:45 PM
I tried to think of this problem. The conclusion is that it is too difficult to add for the general case, at least for now  :(
Title: Re: Alternative breaks
Post by: Liviu Lalescu on February 21, 2024, 05:25:33 PM
In FET-6.17.0, released on 16 February 2024, there is a new constraint, teacher(s)/students (set) max hours daily in hourly interval. I think this is the solution to the alternate breaks problem.

Unfortunately, the gaps are counted in these breaks. I see no solution. You might solve this by increasing the maximum allowed gaps.