Hello
Finally I think I reach the final constraints. Now I would like to generate a full timetable.
Please see the attached FET file.
This time I deactivated some room constraints like Liviu suggested on a previous thread. But I need to keep rooms of Artes Visuales / Música activated because it is mandatory that those teachers must teach at the same time.
I didn't change "max hours daily" because I did not understand how to do it from here: https://lalescu.ro/liviu/fet/forum/index.php?topic=5495.0
I also "split" some activities of 4C -- you can rollback if it is better. Perhaps we can do more splits to generate a full timetable.
@Liviu Lalescu could you change some of activities of other courses (not all) to see if a complete timetable is generated (using the attached file), please? I would not like to abuse these more flexible constraints (even if it is legal to do it) since teachers complain because they have many hours with the same course, so I would like to avoid that as much as possible.
Thank you!
Reuploaded FET file! Literally 10 minutes ago someone wrote me to change "Teacher T (Suplente Teacher E)"'s available times, it should be available last 3 slots of Jueves and Viernes. I reuploaded the file
I am playing with max 2 hours daily constraints. First I deactivated all of them and it was successful. Perhaps we can play with those %
Even if we activate all room constraints again (which would be great) but keep deactivated max 2 hours, the generation time is very fast.
Perhaps we can play with max 2 hours constraints.
Yes, I lowered a bit and it is successful. See the attached file and solution.
I applied a filter to the all time constraints, "not contain 100" and "not contain inactive", and lowered their weight.
I will try now as you requested, no more than 2 same subject of same teacher of same students on a day.
I see those 99% and it is great!! Thank you so much!
Quote from: Liviu Lalescu on February 10, 2023, 06:40:28 PMI will try now as you requested, no more than 2 same subject of same teacher of same students on a day.
I would say:
No more than 2 hours of same subject of same teacher of same (set) students on a day.
;D
I added also such constraints. 3 were impossible and from 1 I removed an activity (see the constraints min days between activities). It solved (more difficult). See attached.
I will try now with more preferred rooms constraints active.
How long did it take you to generate the timetable?
Is there somewhere where the generation time you got is saved? Because the seed does not tell how many time did it take.
2m 19s, but I generated on 8 threads simultaneously, so the chance of a solution is much higher.
Quote from: Liviu Lalescu on February 10, 2023, 06:55:35 PMI added also such constraints. 3 were impossible and from 1 I removed an activity (see the constraints min days between activities). It solved (more difficult). See attached.
I will try now with more preferred rooms constraints active.
The ones that you found impossible are actually allowed on the school. The subjects Artes Visuales and Música are the only subjects that can be teached without regarding the min days between.
That's why somehere I added max = 16 to those subjects, but it seems FET does not complain about it. I added max = 16 to avoid such impossibilites.
I don't understand, what is "max = 16"?
Time constraint
(not perfect)
A teacher for an activity tag must respect the maximum number of hours daily
Weight (percentage)=100%
Teacher=Teacher AA/Teacher AB
Activity tag=1C
Maximum hours daily=16
These constraints are redundant and just slow down FET :)
Quote from: Liviu Lalescu on February 10, 2023, 07:15:17 PMThese constraints are redundant and just slow down FET :)
Oh, I didn't know... sorry.
What I say is that the impossibilites that you found are actually not in my school. So I tried to manage a way to tell FET that does not bother about those broken constraints. But I didn't found a way. We can do it manually but it is hardcoded.
You need to edit/remove manually the constraints min days between activities or tag max hours daily.
Ok
In liviu6 it is not necessary that consecutive if same day = yes. They can be separated.
I hope good news :) I obtained (by luck, a very fast solution, 48s, but could take 10 minutes without solving). I attach. I made subject preferred rooms 99% and the final conflicts are low.
I did with consecutive if same day = true. If needed, I could generate some more with consecutive if same day = false.
Quote from: Liviu Lalescu on February 10, 2023, 07:41:01 PMI did with consecutive if same day = true. If needed, I could generate some more with consecutive if same day = false.
Please. I am changing every yes with no (I'm not in my usual computer).
Also, the room constraints should be activated. This is importat for us because some teachers need to occupy those rooms.
Quote from: Liviu Lalescu on February 10, 2023, 06:55:35 PMI added also such constraints. 3 were impossible and from 1 I removed an activity (see the constraints min days between activities). It solved (more difficult).
You said:
Liviu: removed Id 118
but we can't delete activities. Did I understood wrong?
Quote from: darkwindow on February 10, 2023, 07:44:10 PMQuote from: Liviu Lalescu on February 10, 2023, 06:55:35 PMI added also such constraints. 3 were impossible and from 1 I removed an activity (see the constraints min days between activities). It solved (more difficult).
You said:
Liviu: removed Id 118
but we can't delete activities. Did I understood wrong?
Removed ID 118 only from this constraint (min days between activities).
Quote from: darkwindow on February 10, 2023, 07:42:45 PMQuote from: Liviu Lalescu on February 10, 2023, 07:41:01 PMI did with consecutive if same day = true. If needed, I could generate some more with consecutive if same day = false.
Please. I am changing every yes with no (I'm not in my usual computer).
Also, the room constraints should be activated. This is importat for us because some teachers need to occupy those rooms.
When 100%, no need to put "no" instead of "yes". Only for <100%. I'll change.
The rooms constraints is activated, but 99%, because 100% seems impossible. In my liviu11 solution above only one such constraint is broken.
Quote from: Liviu Lalescu on February 10, 2023, 07:48:33 PMWhen 100%, no need to put "no" instead of "yes". Only for <100%. I'll change.
I didn't know about that. But you didn't use min days with <100%. What will you change so?
Quote from: Liviu Lalescu on February 10, 2023, 07:48:33 PMThe rooms constraints is activated, but 99%, because 100% seems impossible. In my liviu11 solution above only one such constraint is broken.
I didn't check. I will see it. Thanks!
We don't need to change any constraint min days between activities, because they are either 100% or not active.
I'll try with 100% subject preferred rooms, but I think impossible.
Quote from: Liviu Lalescu on February 10, 2023, 07:52:50 PMWe don't need to change any constraint min days between activities, because they are either 100% or not active.
That's why I don't understand what will you change.
If by "I'll change" you meant 100% on room constraints, it is awesome that you found a way to only have 1 conflict. I think there is no need to change anything more.
I will check your last file soon. Thanks for the hard work
Can I ask if the min days constraints that you added are inefficient when there is a change of teacher or new teachers are added?
If there is a teacher that left, then I need to track every single constraint about him, and especifically min days are a lot with respect to other constraints, isn't it?
No need to change constraints min days between activities. They have all weight 100% (and 3 or 4 are inactive), so consecutive if same day is irrelevant.
I tried changing all subject preferred rooms to 100%, but seems impossible.
Please see liviu11 solution, it has only a room not respected.
Quote from: darkwindow on February 10, 2023, 07:58:55 PMCan I ask if the min days constraints that you added are inefficient when there is a change of teacher or new teachers are added?
If there is a teacher that left, then I need to track every single constraint about him, and especifically min days are a lot with respect to other constraints, isn't it?
I used Advanced > Spread of activities evenly over the week, 100%, then deactivated or edited the impossible constraints min days between activities.
Unbelievable, but it solved fast enough with 100% preferred rooms. See two solutions, attached (and the file).
Thanks!
Is there any way to constrain max daily/weekly gaps for all teachers in my file, considering it has 16 hours where the first 8 are for mornings, and the rest are afternoon?
A lot of teachers teach both on morning and afternoon, and supposing its available times are far away (first hours of morning and last hours of afternoon), then max gaps would be easily broken.
You did an amazing job by inserting those constraints!! Thank you Liviu
I need to set those broken constraints to 0.
The excepetions to the rule are:
Time constraint teachers activity tag 1C max 2 hours daily broken for teacher Teacher AA/Teacher AB, on day Lunes, length=3. This increases the conflicts total by 0.95
Time constraint teachers activity tag 2C max 2 hours daily broken for teacher Teacher AA/Teacher AB, on day Lunes, length=3. This increases the conflicts total by 0.95
This 2 can be omitted, but the other must be solved.
I think we are not using the fact that, if an activity is splitted, they can be non-consecutive. It seems strange to me that in the schedule there are hardly any non-consecutive activities.
The room constraints related to "Taller de Producción en Lenguajes" can be deactivated, if needed.
Quote from: darkwindow on February 10, 2023, 09:58:51 PMThanks!
Is there any way to constrain max daily/weekly gaps for all teachers in my file, considering it has 16 hours where the first 8 are for mornings, and the rest are afternoon?
A lot of teachers teach both on morning and afternoon, and supposing its available times are far away (first hours of morning and last hours of afternoon), then max gaps would be easily broken.
For this, you can of course add constraints teacher(s) max gaps per day/week, and/or teacher(s) max span per day.
Quote from: darkwindow on February 10, 2023, 11:51:55 PMYou did an amazing job by inserting those constraints!! Thank you Liviu
I need to set those broken constraints to 0.
The excepetions to the rule are:
Time constraint teachers activity tag 1C max 2 hours daily broken for teacher Teacher AA/Teacher AB, on day Lunes, length=3. This increases the conflicts total by 0.95
Time constraint teachers activity tag 2C max 2 hours daily broken for teacher Teacher AA/Teacher AB, on day Lunes, length=3. This increases the conflicts total by 0.95
This 2 can be omitted, but the other must be solved.
I think we are not using the fact that, if an activity is splitted, they can be non-consecutive. It seems strange to me that in the schedule there are hardly any non-consecutive activities.
The room constraints related to "Taller de Producción en Lenguajes" can be deactivated, if needed.
If the constraint min days between activities is inactive, we are allowing non-consecutive. It is just luck.
You can reduce the weight or deactivate for room constraints for TPL.
For teacher(s) activity tag max hours daily, there are also impossible for teachers Teacher H and tag 2A, and teacher Teacher Au and tag 5B.
Unfortunately, for these tags you need to add a constraint for each teacher, as FET does not allow exceptions.
I tried a bit without exceptions (and 99% for impossible), but it seemed too difficult.
You might want to do these things and try.
I added manually the constraints (only the needed ones). See the attached file. With max gaps = 6 for teachers it stops at 260, and without it stops at 266 I think.
I'd say you settle for a solution with liviu12.fet. If you want, I can generate more files for you, so you have to choose from more.
I added only these in the new file liviu17.fet:
P-4C
D-5C
B-5C
K-4B and 5B
X-4C
Y-2C
H-2A (impossible, removed)
I-1B
AL-4A
AP-5A
AQ-3A
AS-4C
AU-4A, and 5B (impossible, removed).
I obtained 10 timetables without caring about max gaps for teachers. See attached files. For the solutions, see the report.txt file and go to that directory.
I am now trying with max 6 gaps per week for teachers and I already have 1 timetable. I will post a new reply with it, a bit later, I still left it computing.
I think the broken activity tag max hours daily cannot be improved.
I obtained 3 timetables with max gaps per week = 6. Attached.
I am now trying with teachers max gaps per week = 6 and per day = 4. It seems tough. I'll let you know.
Hello
But max gaps per week is a secondary problem.
We need to solve those broken constraints.
A teacher cannot exceed max = 2 hours daily with the same subject on a day. If a teacher teachs different subjects on same course, each subject has to be max = 2 hours daily.
Once we figure that out, I think it's time to go look at the gaps.
I propose to start again from liviu12 and figure out how to solve all "max 2 hours daily broken", with the exception of 2 (see message #28)
Thank you
Hello,
It did not solve with max gaps per day = 4.
liviu20.fet and liviu20-with-teachers-max-gaps.fet are better than liviu12.fet, because I only added the constraints for the needed tags.
As I told you, for Teacher H - 2A and for Teacher AU - 5B it is evidently impossible. So I deactivate these.
For the rest I tried many times with 99.5%, and each time 3 constraints of this type were broken. Feel free to make them 100%. It won't solve, and the problem is your too constrained file.
Hello
Quote from: Liviu Lalescu on February 11, 2023, 08:26:09 AMFor teacher(s) activity tag max hours daily, there are also impossible for teachers Teacher H and tag 2A, and teacher Teacher Au and tag 5B.
For Teacher AU a possible (but not only) distribution could be:
Teacher-AU.png
Quote from: Liviu Lalescu on February 11, 2023, 01:10:08 PMAs I told you, for Teacher H - 2A and for Teacher AU - 5B it is evidently impossible. So I deactivate these.
For Teacher H he has 3 hours with 2A but 2 are from one subject and 1 hour is for another. Under the school restrictions, he can teach without breaking the rule, since these are 2 different subjects. This also happen with Teacher AU (see image above).
Quote from: darkwindow on February 11, 2023, 01:16:06 PMQuote from: Liviu Lalescu on February 11, 2023, 01:10:08 PMAs I told you, for Teacher H - 2A and for Teacher AU - 5B it is evidently impossible. So I deactivate these.
For Teacher H he has 3 hours with 2A but 2 are from one subject and 1 hour is for another. Under the school restrictions, he can teach without breaking the rule, since these are 2 different subjects. This also happen with Teacher AU (see image above).
Oh, I understand now. Let me check what I did. I'll let you know.
I did it, and obtained 2 solutions relatively easy. Let me know if you want me to generate some more solutions for you.
I am now trying with teachers max gaps per week = 6, but it is difficult.
I am not sure, I might be away from the computer for an hour or so.
I think this FET file from liviu12 is almost correct.
The only problem is Teacher AH (Suplente Teacher O) which has 3 hours of Matemática on 2C on same day.
So we need to solve this problem. The room constraints were activated, isn't it?
The other broken constraints are not violating the school rule. Don't you think?
I forgot to include that Teacher AM must teach with Teacher AQ 1 hour in Matemática 1A and 1 hour Matemática 1B.
Quote from: darkwindow on February 11, 2023, 01:33:39 PMI think this FET file from liviu12 is almost correct.
The only problem is Teacher AH (Suplente Teacher O) which has 3 hours of Matemática on 2C on same day.
So we need to solve this problem. The room constraints were activated, isn't it?
The other broken constraints are not violating the school rule. Don't you think?
I removed activity ID 118 from the min days between activities constraints, because otherwise the timetable seemed impossible very early. It is probably impossible.
Quote from: darkwindow on February 11, 2023, 01:39:46 PMI forgot to include that Teacher AM must teach with Teacher AQ 1 hour in Matemática 1A and 1 hour Matemática 1B.
OK then, include and then try to generate, as I taught you. I would advise you to work in liviu21.fet.
You might need to add a constraint min days between activities for the new activities, 100% eventually, or teacher activity tag max 2 hours daily, 99.5%.
Quote from: Liviu Lalescu on February 11, 2023, 01:43:34 PMYou might need to add a constraint min days between activities for the new activities, 100% eventually, or teacher activity tag max 2 hours daily, 99.5%.
What are the "new activities" you are referring to?
Quote from: Liviu Lalescu on February 11, 2023, 01:43:34 PMOK then, include and then try to generate, as I taught you. I would advise you to work in liviu21.fet.
Yes, I added it. The generation took ~2 m. Many thanks!
Matemática of 1A (and 1B) has split 2-2-1. I added the teacher to the third index (the one that has 1 hour), but he could teach on 1 hour of the first 2 indexes. However this is really not a problem, since FET could solve easily when I added it to the 1 hour. But I think if we were more flexibe, it is better. I didn't know how to do it more flexible so I left with the 3rd index.
What's left to do? Restrict the max gaps? For these, I think it is not possible due the way I added the teachers. For example Teacher K could have a lot of gaps, but that's why I have another teacher called "Teacher AN (Suplente Teacher K)" who "fill" those gaps.
What I'm interested on now is try to have teacher's min hours daily = 2 (not 1). However some teachers only teach 1 hour, so I guess this should be done manually.
Quote from: darkwindow on February 11, 2023, 01:56:41 PMWhat are the "new activities" you are referring to?
These: "I forgot to include that Teacher AM must teach with Teacher AQ 1 hour in Matemática 1A and 1 hour Matemática 1B. "
Quote from: darkwindow on February 11, 2023, 02:15:12 PMWhat I'm interested on now is try to have teacher's min hours daily = 2 (not 1). However some teachers only teach 1 hour, so I guess this should be done manually.
Yes, add for each one.
Quote from: Liviu Lalescu on February 11, 2023, 02:17:28 PMThese: "I forgot to include that Teacher AM must teach with Teacher AQ 1 hour in Matemática 1A and 1 hour Matemática 1B. "
Oh, adding a teacher to an existing activity cause a new activity?
Instead of:
17 - 1/5 - Teacher AQ - Matemática - 1A - 1A
we would have:
17 - 1/5 - Teacher AQ,Teacher AM - Matemática - 1A - 1A
(The same for 1B)
It is the same activity id.
Trick: if you have an activity (1+1+2 or 2+2) or another one (1+2+2), you could add (1+1+1+1) or (1+1+1+1+1), min 1 days between them with 0%. In this way, FET won't place more than 2 on the same day. Then you can add one or two constraints 2 activities consecutive.
Quote from: darkwindow on February 11, 2023, 02:19:38 PMQuote from: Liviu Lalescu on February 11, 2023, 02:17:28 PMThese: "I forgot to include that Teacher AM must teach with Teacher AQ 1 hour in Matemática 1A and 1 hour Matemática 1B. "
Oh, adding a teacher to an existing activity cause a new activity?
Instead of:
17 - 1/5 - Teacher AQ - Matemática - 1A - 1A
we would have:
17 - 1/5 - Teacher AQ,Teacher AM - Matemática - 1A - 1A
(The same for 1B)
It is the same activity id.
OK, no new activity, sorry.
PS: In your first files (liviu12.fet), you forgot to add tag 4C to some activities of Teacher P. I corrected in liviu21.fet.
Quote from: Liviu Lalescu on February 11, 2023, 02:17:47 PMYes, add for each one.
We have "Min hours daily with an activity tag for all teachers" constraint. But do you still suggest to add manually?
I think you want each teacher min hours daily = 2, with exceptions. Exceptions are not possible in FET, so add for each teacher.
Quote from: Liviu Lalescu on February 11, 2023, 02:23:27 PMI think you want each teacher min hours daily = 2, with exceptions. Exceptions are not possible in FET, so add for each teacher.
You are right. But we can add tags for all teachers except for some teachers
Quote from: Liviu Lalescu on February 11, 2023, 02:21:14 PMPS: In your first files (liviu12.fet), you forgot to add tag 4C to some activities of Teacher P. I corrected in liviu21.fet.
I see. Thank you!
However the new activities of Teacher P were added because if not, the generation would impossible. That's why I deactivated some of the Teacher P activities
It is better to add like I said, teacher min 2 hours daily, for each teacher, then deactivate the impossible. You press Down, Enter, Down, Enter, adds fast.
Quote from: Liviu Lalescu on February 11, 2023, 02:26:30 PMIt is better to add like I said, teacher min 2 hours daily, for each teacher, then deactivate the impossible. You press Down, Enter, Down, Enter, adds fast.
Ok. I will do it.
I also will try to activate all deactivated activities. Like 2 days ago, if we didn't split manually those activities, the generation was impossible.
Perhaps with these new changes, we can rejoin the activities as before.
Quote from: darkwindow on February 11, 2023, 02:28:57 PMQuote from: Liviu Lalescu on February 11, 2023, 02:26:30 PMIt is better to add like I said, teacher min 2 hours daily, for each teacher, then deactivate the impossible. You press Down, Enter, Down, Enter, adds fast.
Ok. I will do it.
I also will try to activate all deactivated activities. Like 2 days ago, if we didn't split manually those activities, the generation was impossible.
Perhaps with these new changes, we can rejoin the activities as before.
See my reply #49. You can add, for 2+2 -> 1+1+1+1, then one constraint 2 activities consecutive 100% for the first 2 and 2 acts. consec. 95% or something for the last 2.
I didn't understand what are the benefits from doing that, instead of deactivating activities and creating ones with less durations
Quote from: darkwindow on February 11, 2023, 02:48:05 PMI didn't understand what are the benefits from doing that, instead of deactivating activities and creating ones with less durations
In my reply #57, FET will prefer to place 2+2 (95%). If it cannot, it will place 2+1+1 (5%).
But feel free to try other approaches.
Quote from: Liviu Lalescu on February 11, 2023, 02:51:45 PMIn my reply #57, FET will prefer to place 2+2 (95%). If it cannot, it will place 2+1+1 (5%).
This implies that I don't understand how indexes work.
My criteria for creating activities was (this was done like a month ago, when I started using FET):
If a subject is 1 hour duration -> activity index number = 1, duration = 1
If a subject is 2 hour duration -> activity index number = 1, duration = 2
If a subject is 3 hour duration -> activity index number = 2, duration = 2, duration = 1
If a subject is 4 hour duration -> activity index number = 2, duration = 2, duration = 2
If a subject is 5 hour duration -> activity index number = 3, duration = 2, duration = 2, duration = 1
Why this criteria? Because we must not have more than 2 hours per day on same subject on same course.
But if you are saying that there is a better approach to prevent this...
Was I doing it wrong all the time? In that case I would like to repair it, but I think it would take a long time to change all the activities... :-[
I added min hours daily constraints. I also increased Teacher AM available times on Viernes so that FET can have more space to put its Teacher AM Educación Tecnológica 2C activity (although it seems impossible, it always places it on Viernes 1º hour). But we need to restrict Teacher AM Intr. al Cálculo Numérico 1C time slots/starting times to the last 2 hours on Viernes. So I added it.
Please see attached FET file.
It goes crazy at some activity. I deleted/deactivated min hours daily constraints that causes those conflicts but it didn't work.
Perhaps I am missing a conflict that I don't see.
Quote from: darkwindow on February 11, 2023, 02:55:59 PMQuote from: Liviu Lalescu on February 11, 2023, 02:51:45 PMIn my reply #57, FET will prefer to place 2+2 (95%). If it cannot, it will place 2+1+1 (5%).
This implies that I don't understand how indexes work.
My criteria for creating activities was (this was done like a month ago, when I started using FET):
If a subject is 1 hour duration -> activity index number = 1, duration = 1
If a subject is 2 hour duration -> activity index number = 1, duration = 2
If a subject is 3 hour duration -> activity index number = 2, duration = 2, duration = 1
If a subject is 4 hour duration -> activity index number = 2, duration = 2, duration = 2
If a subject is 5 hour duration -> activity index number = 3, duration = 2, duration = 2, duration = 1
Why this criteria? Because we must not have more than 2 hours per day on same subject on same course.
But if you are saying that there is a better approach to prevent this...
Was I doing it wrong all the time? In that case I would like to repair it, but I think it would take a long time to change all the activities... :-[
You did it correctly like above. But then you said the activities with duration 4, which you added 2+2, may be placed 2+1+1 (because your first approach was too difficult to find a timetable). So this is why I suggested my reply #57 and #49.
Note: if you decide to implement this, you might need to remove the old activities and add the new ones. Please take care to add the new activities in the old constraints (like not overlapping, which take care of the IDs of the activities).
I hope good news: I obtained a timetable for your file in post #61 (I modified the file). Attached. I needed to deactivate 4 obviously impossible constraints min 2 hours daily.
I hope even better news: Very hard, I obtained a solution with teachers max gaps per week = 6. Attached.
Quote from: Liviu Lalescu on February 11, 2023, 05:38:43 PMI hope even better news: Very hard, I obtained a solution with teachers max gaps per week = 6. Attached.
Wow, you and FET did an amazing job!!! I am checking if there are any mistake when I entered the data, I hope I don't find them...
While I'm checking that, we all know that Math (Matemática in Spanish) is not good for students at first 2 hours of Mornings... can FET find a good timetable like you recently found including this restriction for all courses 1A,1B,2A,2B..5A,5B with Matemática? ;)
That is not necessary but it would be funny to check this haha
I found that teachers "Teacher T (Suplente Teacher B)" and "Teacher S (Suplente Teacher B)" must have the same available times as Teacher B
I will correct that from liviu6
No need to lock any activity preferred starting time!! It worked after changing its available times!
That's amazing...
Added fixed file
Quote from: darkwindow on February 11, 2023, 06:14:18 PMQuote from: Liviu Lalescu on February 11, 2023, 05:38:43 PMI hope even better news: Very hard, I obtained a solution with teachers max gaps per week = 6. Attached.
Wow, you and FET did an amazing job!!! I am checking if there are any mistake when I entered the data, I hope I don't find them...
While I'm checking that, we all know that Math (Matemática in Spanish) is not good for students at first 2 hours of Mornings... can FET find a good timetable like you recently found including this restriction for all courses 1A,1B,2A,2B..5A,5B with Matemática? ;)
That is not necessary but it would be funny to check this haha
No, it seems impossible. I added preferred time slots for Matematica subactivities with split index 1 and 2 (two constraints), and it stays at 118/325 placed.
Quote from: Liviu Lalescu on February 11, 2023, 06:38:56 PMNo, it seems impossible. I added preferred time slots for Matematica subactivities with split index 1 and 2 (two constraints), and it stays at 118/325 placed.
No problem. It was not necessary. Thanks for testing
If there is news, I will come back here
You are welcome!
Please let me know if I can write you a kind of appeal/personal stuff (here).
It occurs that
282 - 2 - Teacher A (Suplente Teacher K) - Metodologías de Proyectos - 5B - 5B
and
272 - 2 - Teacher K - Desarrollo de Proyectos de Producción - 5B - 5B
were consecutive last year, and same happens with our last files. Both 5B students and Teacher K are tired of having so many hours. I'm seeing if both activities can be put on other days. It is not mandatory but it would be better.
That is, Teacher K should teach in two different courses instead of 5B. Maybe you can help me with that
Quote from: Liviu Lalescu on February 11, 2023, 06:53:41 PMPlease let me know if I can write you a kind of appeal/personal stuff (here).
Yes
Edit
Oh, I see it would be impossible due to Teacher K available times.
Maybe we can find a timetable where Teacher K (and also Teacher AN (Suplente Teacher K) and Teacher A (Suplente Teacher K)) can teach 5B with min gaps = 1 or 2 between activities of duration = 2.
Quote from: darkwindow on February 11, 2023, 07:19:02 PMOh, I see it would be impossible due to Teacher K available times.
Maybe we can find a timetable where Teacher K (and also Teacher AN (Suplente Teacher K) and Teacher A (Suplente Teacher K)) can teach 5B with min gaps = 1 or 2 between activities of duration = 2.
OK, I let it compute with teachers max gaps per week = 6 and added min 2 gaps between (272,273,282,285,288). I'll let you know.
My personal appeal, for you and for all the FET users, is this: FET is completely free (libre) software. It requires very much dedication. If you consider it useful, please consider recommending your institution to make a benevolent donation or other kind of help to this project.
Quote from: Liviu Lalescu on February 11, 2023, 07:30:08 PMMy personal appeal, for you and for all the FET users, is this: FET is completely free (libre) software. It requires very much dedication. If you consider it useful, please consider recommending your institution to make a benevolent donation or other kind of help to this project.
I was already determined to do it. If the institution rejects it, I will take care of finding a way to donate to the project. I need to see if I can sign to PayPal or someone else can.
Thank you for the hard work!
Thank you for the kind thoughts!
I let it compute. There are hopes. It reached 320/325 in one try. I am generating multiple with a 10 minutes limit each. I will leave it overnight if it won't find a timetable until sleep time.
Quote from: Liviu Lalescu on February 11, 2023, 07:44:27 PMI let it compute. There are hopes. It reached 320/325 in one try. I am generating multiple with a 10 minutes limit each. I will leave it overnight if it won't find a timetable until sleep time.
Thank you. If it not possible, at least try to divide those 4 hours by a break time to give both students and teacher a little breather (if you remember, morning break times are between hours 2 and 3, and between hours 4 and 5). Actually last year and in FET those subjects are teached from hour 5 to hour 8, where there are no break times.
Edited numbers
Quote from: darkwindow on February 11, 2023, 08:02:53 PMIf it not possible, at least try to divide those 4 hours by a break time to give both students and teacher a little breather (if you remember, morning break times are between hours 2 and 3, and between hours 4 and 5). Actually last year and in FET those subjects are teached from hour 5 to hour 8, where there are no break times.
OK, I know how this can be inputted (5 constraints activities occupy max time slots from selection).
I'll try the better way (2 hours gaps) - if it does not succeed I'll try also this.
I am trying in parallel both methods. Still no solution. But I hope tomorrow morning it will be. I got 324/325 in 3 generations. It should be possible, but you are pushing the limits of the program :)
Yesss :) Success, in 4m 50s I obtained the attached timetable, with 2 gaps between them.
Also, only 2 constraints tag max 2 hours daily broken.
I hope now everything will be OK.
I might go to sleep, but I might check again for your answer, because I am very hopeful.
I will leave it to compute further possible timetables.
Edit: I attach also the random seeds, so the generation can be replicated.
Thanks Liviu!
Unfortunately, I think we are not going to get that far because they asked me for a new requirement.
It's about Teacher T (Suplente Teacher C) who teachs Formación Ética y Ciudadana on 2A and 2C. He has only these 2 activities:
66 - 2 - Teacher T (Suplente Teacher C) - Formación Ética y Ciudadana - 2A - 2A
106 - 2 - Teacher T (Suplente Teacher C) - Formación Ética y Ciudadana - 2C - 2C
We need that he teachs these 2 activities consecutively on same day (it doesn't matter which day), first 2A and then 2C (of course this is the order, since first are morning activities).
I think this causes Teacher T (Suplente Teacher C) teaching hours 7 and 8 of mornings and hours 1 and 2 of afternoons (it doesn't matter the day).
So I added:
Two activities consecutive: first act. id: 66, second act. id: 106, WP:100%
Is the constraint I chose correct?
If yes, the first thing I do was to change Minimum number of days between activities id=79 and id=80. I put a comment "Impossible?" and set to 1%.
If the answer is yes, please see attached file. It has minor improvements:
1) Deleted 2 teachers that were not teaching anything.
2) Deactivated two unnecessary "activities must not overlap" constraints. I added them a comment: "OP: Not necessary"
3) Updated Teacher T (Suplente Teacher B) available times because I forgot to unmark a slot.
I have taken liviu6_available_times_fixed. Please see attached file
However it is not enough to produce a complete timetable. What other changes should we consider?
Hello, darkwindow,
I think you did the changes correctly, from what you said. Unfortunately, I cannot help further with this file - I hope other users can help with advice.
Don't worry, Liviu. You did an amazing job. I'm working on my own to make new changes
Thanks anyway!
Hello again,
I tried some more. I could not obtain a timetable without my new change, even if disabled many constraints. I think you need my new change.
My new change is to allow a late start at second hour for 4C.
I also added 2 preferred starting times, to help FET.
I also deactivated the max gaps for the teachers.
I obtained a timetable with these above 2 relaxations. I attach the file and solution.
Please tell me if it is allowed to do this to your file.
Quote from: Liviu Lalescu on February 12, 2023, 09:20:21 PMMy new change is to allow a late start at second hour for 4C.
I don't think that is possible. In the school it never happened that a course starts late. At some point in the past we discussed that solution, but I was not sure if it was possible, and I don't want to be right now
If the school allow this, I will notify
You might want to see the timetable for 4C and change a teacher's availability to suit for the slot where 4C begins late, and allocate that teacher there.
I think it is not possible otherwise.
May we relax the availability of a teacher / more teachers? I tried making Teacher P available all the afternoon, and I got to 320/325, might finish.
What other teachers can we relax in availability? (if any)
Quote from: Liviu Lalescu on February 12, 2023, 10:16:47 PMMay we relax the availability of a teacher / more teachers? I tried making Teacher P available all the afternoon, and I got to 320/325, might finish.
What other teachers can we relax in availability? (if any)
Unfortunately, we can't modify teacher's available times. We can restrict (doubt we could see it as helpful), but never extend them.
I am working on a new file. I need min days between activities to be working on all cases. There are 2 cases that it can't be respected. Perhaps we can manually split some activities (but taking care of constraints). I will post the file soon, I would be glad if someone can help me identifying those maunal divisions
Oh... I see.
I attach the file.
I think we have only 2 main problems.
1) We need
Activity with id=79 (2/3 - Teacher AK - Taller de Lectura y Comprensión de Textos - 2A - 2A)
Activity with id=80 ( 1/3 - Teacher AK - Taller de Lectura y Comprensión de Textos - 2A - 2A)
to be min days = 1
2) We need
Activity with id=116 (2/5 - Teacher AJ (Suplente Teacher N) - Matemática - 2C - 2C)
Activity with id=117 ( 2/5 - Teacher AJ (Suplente Teacher N) - Matemática - 2C - 2C)
Activity with id=118 ( 1/5 - Teacher AJ (Suplente Teacher N) - Matemática - 2C - 2C)
to be min days = 1 (maybe this is more important than problem 1)
I will try to see what indexes can be manually divided in order to solve these problems. Ideally we should not divide index = 1 but indexes > 1 so we have at least 1 index with duration = 2 (the others can be duration = 1, no problem).
P.S. I set maximum number of gaps per week = 7 because 6 seemed impossible
EDIT: See next message
Update: Problem 2 can be forgotten for the moment.
We must focus on problem 1.
I kept
Teacher min hours daily, WP:100%, T:Teacher AK, mH:2, AED:yes, C:
Liviu: probably impossible (if I am not mistaking)
activated, but I think we should deactivate it.
Also, I will try to divide activities on 2A and focus on its constraints. If I have news, I will post them
I was playing with activities of 2A by creating/deactivating some of them and acts. not overlapping / min days constraints related to them but I couldn't get further than ~300/325.
If you want I attach the fail file.
I tried message #49 for
79 - 2/3 - Teacher AK - T. de Lectura y Comprensión de Textos - 2A - 2A
but it can't generate a full timetable. It got stuck around 298/326 placed activities every attempt.
Any suggestion?
Maybe best is 1+1+1 (say A1, A2, A3), 0% (take care, 0%!!!), min 1 days, consecutive if same day = true (I suppose). And add a constraint two activities consecutive for A1 and A2, if you need such.
In this way, FET will never place A1, A2, and A3 on the same day.
Then, take care of the teacher, if he has only 3 hours, he cannot have min 2 hours daily.
I have 8 core processor. I generate multiple on 8 threads. If it gets stuck at the same activity in nearly all the threads in a relatively short time (say 298/326), I analyze activity 299 in the initial order (generate single to see the initial order). I also analyze the highest-stage timetable (with 298/326 activities placed).
You are pushing the limits of feasibility, that is why your timetable is so difficult to obtain.
Yes I did that, as you noted we are stuck.
For indexes > 1 whose duration > 1, we can delete them and instead create new activities with indexes > 1 whose duration = 1 (first two activities consecutive), so we can allow non-consecutive subactivities. That's not a problem for the school.
We should take care of restrictions related to them, of course.
Should this be enough to find a full timetable? But this would imply a long work
I am not sure if this is enough to finish a timetable - you want to have very strong constraints and I am not sure it is feasible.
It might be possible to write a portion of code for FET to automate this process of converting from the old activities to the new ones. I am not sure if it is very complicated or how long would it take - might take a couple of hours or less.
Don't worry. I am testing creating manually and it does not take too long. I am picking those activities to change; those that are not assigned to any room, so it is easier.
However, it happens that as I deactivate the old activities and create the new ones, each time FET places fewer activities. For example, I have divided several activities and it stays in:
312 out of 353 -> 353 - 312 = 41
but we had before:
326 - 298 = 28
Why this happens? Shouldn't it be easier for FET to place activities like 1+1+1+1 that are possibly non-consecutive (except the first 2) than those that are consecutive pairwise like 2+2?
The initial order changes. Usually, activities with duration 2 are placed before those with duration 1.
(the conflicting index is multiplied with the duration.)
Another question: I am using "two activities are grouped" instead of "two activities are consecutive" because we don't care about the order. Do you still suggest "consecutive" for performance reasons? Or is it the same in our case?
If I remember correctly, consecutive might be more efficient (because the initial order is better). Yes, I checked, it is better. So, if the activities are equivalent, prefer consecutive.
Thanks for the help!
Quote from: Liviu Lalescu on February 14, 2023, 09:57:47 PMMaybe best is 1+1+1 (say A1, A2, A3), 0% (take care, 0%!!!), min 1 days, consecutive if same day = true (I suppose). And add a constraint two activities consecutive for A1 and A2, if you need such.
In this way, FET will never place A1, A2, and A3 on the same day.
I don't understand why FET will never place them on same day.
We say 1+1+1 (say A1, A2, A3). At the moment FET can still place A1, A2 and A3 on same day.
Weight = 0%. We don't add any new revelant information. FET can still place A1, A2 and A3 on same day.
Min days = 1. Since it is 0%, I guess it doesn't matter. FET can still place A1, A2 and A3 on same day.
Consecutive = no. FET can still place A1, A2 and A3 on same day.
two acts are consecutive: A1 and A2. FET can still place A1, A2 and A3 on same day (for sure A1, A2 are placed on same day).
With this, how does FET know that A1, A2 and A3 are not placed on same day?
EDIT: Maybe because we set min days = 1. But that 0% baffles me... why 0% instead of 100%, differences?
I couldn't get any improvement from before. I deactivated some "not so important" constraints, so we should get better performance. I got even worse results. :-[
I deactivated activities whose (index = 1 && duration = 2) of courses 2A, 2B, 2C, 3C and 5C.
Then I created new activities of indexes = 4 or 5 with duration = 1 each, min days = 1, 0%, consecutive = no.
Then, for each new activity, I set "two activities are consecutive" for the first 2 subactivities.
But in all cases, it places 312 out of 368 activities, so 368 - 312 = 56...
The file is attached. Can someone take a look if I made a mistake, please?
By design, if there is a constraint min days between activities, FET will not place three activities on the same day. Maximum two. 0% because you don't care if there is one activity on a day or two.
FET will not place three acts on same day altough we picked 5 or 6 activities for min days constraint?
Yes, exactly. It is documented somewhere (I think twice) in the help. A1, A2, ..., An, min 1 days between activities with 0%, FET won't place 3 activities (Ai, Aj, Ak) on the same day.
Thanks!
Quote from: darkwindow on February 14, 2023, 11:43:10 PMI couldn't get any improvement from before. I deactivated some "not so important" constraints, so we should get better performance. I got even worse results. :-[
I deactivated activities whose (index = 1 && duration = 2) of courses 2A, 2B, 2C, 3C and 5C.
Then I created new activities of indexes = 4 or 5 with duration = 1 each, min days = 1, 0%, consecutive = no.
Then, for each new activity, I set "two activities are consecutive" for the first 2 subactivities.
But in all cases, it places 312 out of 368 activities, so 368 - 312 = 56...
The file is attached. Can someone take a look if I made a mistake, please?
Can someone help me with this, please?
Hello Liviu
Quote from: Liviu Lalescu on February 15, 2023, 02:47:55 PMYes, exactly. It is documented somewhere (I think twice) in the help. A1, A2, ..., An, min 1 days between activities with 0%, FET won't place 3 activities (Ai, Aj, Ak) on the same day.
I don't understand why 0%. Shouldn't be 95%, 99% or even 100%?
In the case I picked A1 (duration=2), A2 (duration=1), A3 (duration=1) for constraint min 1 days 0%, please correct me:
In one day can occur:
- A1 yes
- A2 yes
- A3 yes
- A1,A2 no
- A1,A3 no
- A2,A3 yes (correct me here)
- A1,A2,A3 no
If I'm correct, what is the difference between setting 0%, 99% or 100%?