Hello,
I would like to have activities that do not count towards time or space rules. I have breaks that have to be within a specific time range so that students can eat while the restaurant is open.
If I put an activity for that FET finds places for me, which is a great help but then rules like students max hours continuously trigger and my schedule breaks.
What i'm after are "soft" breaks.
Thanks,
George
I am not 100% sure if such a rule will be needed and/or good.
a) adding such a rule might slow down (maybe only a very bit, but it will slowdown)
b) you can force the lunch activity at special times, so you already now that there will be in fact a break. So you only need to add it to the needed max value and all is fine again.
I am happy to consider workarounds.
I don't know the internals about (a) but I would not mind waiting longer to have this convenience.
As for (b), I'm already limiting the lunch activity to the timeslots the restaurant is open. The problem is once placed, the activity counts towards rules such as max hours continuously and "dislodges" other activities, creating gaps where there shouldn't be any, wasting a slot.
If I add an hour to my max hours continuously rules, I get, well, longer continuous days. Our schedule hours are from 9am to 9pm. Max hours continuously is currently 5. If I set it to 6 and add the lunch I can easily get lunch AND 6 hours continuously, which I don't want.
the trick is to force an lunch activity each day.
@Corfiot,
my custom fet have a constraint that forces a minimal time interval without activities within a time span.
Example: From 11am until 13am a/all teacher(s)/student_set(s) have minimum 60min "break".
It was discussed here: https://lalescu.ro/liviu/fet/forum/index.php?topic=3073.0
Yes, that is also possible.
You might also use time constraint max hours with an activity tag. (of course it mean you need to tag nearly all activities).
Difficult to say what is the best for your dataset without knowing your dataset.
I myself also simply just add 5 lunch activities with min 100% constraint. So lunch is forced each day. i can force the hours (at my school normaly only 6th hour, but 5th hour is also used sometimes) by preffered starting time constraints. So a min day constraint is simply 1 larger then without lunch.
This variant is very fine as long as students don't have got free days and not too empty timetables. so it should be fine for "default" schools.
rodolforg variant and the tag variant will be better if your students are allowed to have free days or a very low number of hours at a day.
I am tempted to go with rodolforg's solution, an actual implementation of this. However, it seems it's a bit behind from Liviu's master. Maybe we can collaborate rodolforg? I do some development myself.
I would like this functionality added to FET directly, even though it sounds a bit confusing as a constraint. It only needs some decent documentation. I think a lot of schedules need lunch breaks (I need them for students, not teachers).
Also, the tag variant won't work because I have "max hours daily" and "max hours continuously" for both teachers and students that count the "break" and produce wrong results.
My dataset if a university department where we make schedules according to rules for professors and students with a working 12 hours in the day (9am to 9pm). So we don't just use "day" rules, there's a lot of "hour" rules involved that must be respected. If you want to take a look, the file is attached. I was forced to add rigid "breaks" for students, which makes further changes effectively impossible.
You can try rodolforgs solution of course.
In my opinion:
a) You dataset don't need it, since students have got activities every day and there are also enough activities each day. So currently just force a lunch activity each day. Of course you need to use the max "tag" constraints and increase the value 1 time. The numbers won't be wrong by that. It will be the same.
b) i don't think not counting activities will be good, since that solution will slowdown many other files, even if they don't use that feature. A much better variant will be adding a new constraint "max working in an hourly interval per day". Because this won't slow down other files, it will speed up your file and it will be much easier to enter the data.
Quote from: Corfiot on September 26, 2018, 11:51:33 AM
Hello,
I would like to have activities that do not count towards time or space rules. I have breaks that have to be within a specific time range so that students can eat while the restaurant is open.
If I put an activity for that FET finds places for me, which is a great help but then rules like students max hours continuously trigger and my schedule breaks.
What i'm after are "soft" breaks.
Thanks,
George
This is a good suggestion - I think more users suggested until now; unfortunately, complicated. I added it for now in the TODO list.
Quote from: Corfiot on September 27, 2018, 11:21:03 AM
Also, the tag variant won't work because I have "max hours daily" and "max hours continuously" for both teachers and students that count the "break" and produce wrong results.
You have constraints teacher(s)/students (set) activity tag max hours daily/continuously. For daily, activate and neglect the warning.
Liviu, why not adding "max working in an hourly interval per day"? That will help all users that as for a feature like Corfiot asked for, but without the disadvantages. It will even have some more advantages, since the user need less activities; so it will properly even make the dataset easier to solve.
Quote from: Volker Dirr on September 27, 2018, 05:48:10 PM
Liviu, why not adding "max working in an hourly interval per day"? That will help all users that as for a feature like Corfiot asked for, but without the disadvantages. It will even have some more advantages, since the user need less activities; so it will properly even make the dataset easier to solve.
At first, I thought you suggest teacher(s)/students (set) interval max days per week, but you suggest something else.
But I think what you suggest can be done with the magic constraint activities occupy max slots from selection. The problems are that the user needs to add n_days_per_week*(n_teachers+n_students_sets) constraints (many constraints), and that for the students it is problematic, the activities in the constraints must be added for each subgroup (or group, if the data contains no subgroups, or year, if the data contains no groups) (see explanation (1*) below).
1*: If there are activities A1 for group G and activities A2 for subgroup S, G contains S, for S the user must add A1 and A2 in the constraint.
The "magic constraint activities occupy max slots from selection" has got 2 big disadvanatges in this cases:
1. It is too complicated to enter the data. Users won't use it, since they must enter much data and as soon as they modify a bit the dataset they must also update that constraint again. even if they will do all this stuff: the chance to do a bug is very high and it isn't very easy to find bugs. My suggestion won't have got that disadvanatge.
2. My suggestion is internally easier to check. So generating will be faster with my suggested special constraint.
You are wrong with (2.) The "occupy max" constraint is optimized nearly perfectly.
The tag suggestion is interesting but I don't see how I can implement it without tagging every activity except breaks with a tag.
Then I would have this tag in the output and that's no good. I will try it out, however.
Thank you all for your suggestions.
Quote from: Corfiot on September 27, 2018, 06:25:41 PM
The tag suggestion is interesting but I don't see how I can implement it without tagging every activity except breaks with a tag.
Yes, some work to do.
Quote
Then I would have this tag in the output and that's no good. I will try it out, however.
You can make an activity tag not printable in the activity tags dialog (where you add the activity tag).
Woa I didn't notice that feature. I'll test it next time someone requests a change and let you know how it goes.
I fear i am right with (2). Your bug is that you didn't noticed that i talk about a special variant. That special variant don't need so much checks. of course the current max occupy constraint is (nearly) perfect.
Example:
teacher need "lunch" at 6th or 7th hour.
so i suggest "max occupy 1 at hour 6th or 7th per day.
So in my variant the constraint only need to read 2 timeslots each day to answer the question. So at normal timetables it need to read only 2*5=10 interger values.
But the current max occupy constraint also need to check if the activity at that slot is also a selected activity from the constraint. Most teachers work over 20 hours per week. So in worst case it need to check 5*20=100 integer values. So it will be slower.
Quote from: Volker Dirr on September 27, 2018, 06:36:51 PM
I fear i am right with (2). Your bug is that you didn't noticed that i talk about a special variant. That special variant don't need so much checks. of course the current max occupy constraint is (nearly) perfect.
Example:
teacher need "lunch" at 6th or 7th hour.
so i suggest "max occupy 1 at hour 6th or 7th per day.
So in my variant the constraint only need to read 2 timeslots each day to answer the question. So at normal timetables it need to read only 2*5=10 interger values.
But the current max occupy constraint also need to check if the activity at that slot is also a selected activity from the constraint. Most teachers work over 20 hours per week. So in worst case it need to check 5*20=100 integer values. So it will be slower.
I challenge your 2*5: the algorithm needs to go through these two slots, but how do you know they belong to teacher T?
More about present code: I used QSet-s, for best performance. See generate.cpp, lines 9728-9861.
because i suggest to read them from "teachersTimetable". I only need to check if the value is >=0. I don't need to check the exact number.
Quote from: Volker Dirr on September 27, 2018, 07:35:16 PM
because i suggest to read them from "teachersTimetable". I only need to check if the value is >=0. I don't need to check the exact number.
Good observation, Volker! Yes, indeed, the magic constraint "activities occupy max time slots from selection" is very general (admitting activities from more teachers/students), and this is also a weak point, not only a strong point.
So, your code is directly proportional with the number of time slots in the constraint, and mine with the number of activities in the constraint :) I think both our ideas are optimal.