I need a set of activities to be all in the same day and also consecutive.
I managed to make them in the same day by using max days between activities set to zero, but it is still not consecutive.
You may find an activity in the first hour and the rest starting from the 3rd hour for example.
All of these type of activities that I want both consecutive and in the same day have the same subject and teacher too if this is useful.
Grouping can achieve this but it doesn't work for more than 3 activities and I may need more. Also grouping is not as universal of a constraint like a max gaps between activities constraint concept for example.
Thank you.
Hello,
A better usage is if you use same starting day instead of max days between. It optimizes better the initial order. But it is not very important.
I think I need to implement this constraint, it is useful. I am thinking of: ConstraintMaxHoursSpanBetweenActivities (or Hourly instead of Hours?). Do you have a better name suggestion?
So, if you have activities with durations 2,1,1 you need to add max hourly span = 4, and also same starting day and possibly activities not overlapping (if they don't have common teachers/students).
Will you help me testing it, if I make it?
Thank you for the suggestion!
I think a nice name might be ConstraintActivitiesMaxHourlySpan.
I need to ask you something first, though: do you know about the constraint students teacher max span per day? Can't you use it?
He wrote always same subject and teacher. So i guess he has different students.
But maybe it is always in the same room and you can just use something like "max room changes" for the teacher?
I made a small mistake. It should be teacher max span per day, not students. But am not sure it can be applied.
I don't like the solution with rooms changes.
Hello,
Thank you for your reply.
Thanks for suggesting Activities Have Same Starting Day constraint instead of max days between activities, I believe it is more straightforward and will make timetable generation faster.
Regarding Activities Max Hourly Span, this is exactly what I need!
I will definitely help you test it on real data and get back to you with the results.
I will have to set it to the number of activities each teacher has in each subject (maybe using some automation from my side to do it for all subjects and teachers)
I have just noticed that this will solve another problem I had solved before using activities occupy max time slots from selection constraint where I would select all of the available slots for all the activities of each subject and limit it to the max number any teacher has so to maximize overlapping and finish earlier this day for the subject (a requirement).
Using the new constraint I will set the same value for it on all of the subject activities for each subject (no dummy select all available slots here) and also apply it again for the activities of each subject for each teacher to achieve consecutiveness.
I have already used max room changes = 0 for the teacher and it doesn't help. He may have an activity with subject A and then another one with subject B then A again in the same room while I want As to be consecutive and Bs too if they happen to be in the same day for this teacher.
If they are in different days then each subject activities will be consecutive already because teachers have no gaps.
Quick Edit: I have just noticed your suggestion of teacher max span per day and I think it can work as a good temporary solution if I apply it to all teachers each with a different value representing the max number of activities he has for any subject.
This way I may guarantee that each subject will be in a separate day and thus consecutive.
Thank you for that too!
Hello!
You are welcome!
I just looked in the code. Same starting day or max 0 days between activities will show the same behavior while sorting for the initial order or generating; only when removing redundant constraints is better. So it is not an important thing.
The new ConstraintActivitiesMaxHourlySpan will be certainly quite complicated to implement, but I am willing to do it. So please let me know if the temporary solution using teacher max span per day is not perfectly useful; if it is not and the new constraint type is necessary, I will begin working right now.
You are certainly an advanced FET user :) You can tell me more details, if you want, and I am interested in your input file(s) (here or by email).
Hello!
This is a nice compliment from the maker of this genius program :)
Thank you for all of your efforts!
Okay I will keep using max days between activities then if there is not much difference.
Teacher max span per day is a good temporary solution but the only drawback is some optimization for some teachers and I will give an example.
If a teacher teaches 3 subjects in say 10 activities. Sub A has 5 activities, Sub B has 3, Sub C has 2 activities.
If the day has 7 slots then it is possible that in a day he has 5 A and 2 C in the same day NOT ORDERED. So maybe 2 As and 2 Cs then 3 As.
With a max teacher span of the maximum number of activities he has for any subject which equals 5 here because subject A has 5, it is ensured that subject A will have its own day and all of its activities will be consecutive.
But there is a chance that in another day he has the activities of both B and C and it will not be guaranteed that Bs are consecutive and Cs are consecutive. This is the problem of using this constraint to satisfy the requirement and that is why I would need an activities max hourly span constraint here to act as a universal solution for this problem.
If you need the input file for testing I would gladly send it directly to you after I make some modifications.
Please let me know when you are done with it so I can test it myself too.
Thank you!
:) Thank you also for the compliment!
You can keep max days for the present, but for the future files you may consider same starting day. As I told you, it removes better the redundant constraints of type min days between activities in that advanced option (I am not sure you used it).
I am interested in your file(s), to see your data and constraints and also to test the new constraint. I will also make my own files to test. Also, after I hopefully implement the new constraint, I would like to see your updated file, which uses the new constraint type.
I will write here as soon as I have something. From my past experience and judging the request, I assume I might be ready in 1-2 days with something functional.
What operating system version do you use? For instance, do I need to compile for Windows 10 64 bit for you to test a snapshot? Or you can use the sources?
Thanks 😊
I don't use min days between constraints but I will definitely take your advice and use same starting day in the future.
Okay I will make my modifications and send you the input file.
I will be waiting to update it with the new constraint and send it too.
I prefer to use it compiled for windows 10/11 ×64.
All the best!
You're welcome! :)
Best!
Hello again,
It seems that I am ready with the engine part (most important and a bit difficult). Now I have a bit of tedious job of adding it in the interface and testing, but I hope in a few hours I'll be ready. I'll let you know.
If everything is OK, I hope to release a new version in a few days.
Hello,
That is very good to hear! Great job!
I have also sent you my input file privately.
Can't wait to try it.
The coding is ready and seems to work :)
But I want to test more thoroughly, translate the new fields, and then I need to compile for Windows for you. I think in an hour or maximum two I should be ready with a snapshot.
I won't use your file, it is too difficult. And anyway you'll check the new constraint on it. Only after you add the new constraint in your file I will be again interested in it.
That is great news 🥳
I will be waiting for the snapshot.
Yeah my file is a bit complicated, I think it would be a good challenge for the new constraint :)
I have added the snapshot, here: https://lalescu.ro/liviu/fet/download/test/
Please let me know.
I hope to release a new official version of FET soon (in a few days).
Thank you so much.
I will apply it and let you know about the results and the the new file.
Best!
Update 1:
It worked! I have added ~187 constraints of that type to my file (the activities of each subject of each teacher) to ensure they are consecutive.
I removed unnecessary grouping constraints that I used previously to "fix" some activities that were two or three.
It worked and no gaps have been found and if a teacher had 2 subjects in a certain day he will have the activities of each subject ordered as required.
Thank you so much for this work of genius!
I am still trying to use it to replace the activities occupy max time slots from selection constraints and I will keep you updated when I reach something.
Currently it gets stuck on some activities so I get back to them and try to modify constraints and repeat.
Quote from: pnlshd on July 23, 2023, 11:54:07 AMI have just noticed that this will solve another problem I had solved before using activities occupy max time slots from selection constraint where I would select all of the available slots for all the activities of each subject and limit it to the max number any teacher has so to maximize overlapping and finish earlier this day for the subject (a requirement).
Using the new constraint I will set the same value for it on all of the subject activities for each subject (no dummy select all available slots here) and also apply it again for the activities of each subject for each teacher to achieve consecutiveness.
I am sorry, but the above paragraphs remain a mystery to me. I don't understand :)
If it is working with occupy max constraints, it is good. You may of course experiment replacing them with the new constraint, but it is not critical.
Thank you for the appreciation! Time to sleep now, after a hard day. :)
Oh, my bad. I will try to explain them better.
I want all activities of any subject (with all of its teachers) to be all in the same day and this got solved using max days between activities = 0 (or same starting day).
But I also want these activities to not be spread over all the slots of the day. If I have like 20 activities with 5 teachers without other constraints than being in the same day they may be placed over the 7 slots of the day.
What I want is to limit this spread to the lowest possible which is the max number of activities any teacher has in this subject (because the might not be equal). So if one of them has 4 activities I want all of them to occupy max 4 slots of the day (and overlap that is fine).
That is why I used activities occupy max slots from selection constraint. And here the selection was all of the available slots in all days (pretty dummy) because I don't know the exact day that fet will place this subject activities on.
Here comes Activities max hourly span magic! I could use it for this requirement too and it would be set to the same values for each subject's activities that is the max number of activities any teacher in this activity has.
When I tried this at the beginnig there was some things I missed on my side but when I corrected them the result was MAGIC!!!!
The timetable that previously took 15 mins (before and after applying the new constraint but before it had gaps) now was fully generated with all other constraints the same in an impressive 1m 27s!!!!
What is more impressive is that I could even remove a day to make it only 6 days and it still generated a timetable in 8m 47s!!!!!
Liviu, you are a genius and you really should be proud of this work, I am utterly thankful for you.
I will be sending you the two input files (before and after replacement).
Get a well deserved sleep!
Thank you for your kind words! :)
I understand now. However, there is no problem if you use occupy max with all the slots selected, it is normal usage, but it is maybe slower. But it is looking better if you use the new constraint.
Sometimes there are alternatives uses of constraints. I am not sure exactly which ones are definitely faster, that is why I am not decided on which ones to use. But I think occupy max is slower.
I hope to release in a few days the new official version.
As a personal request, maybe you could talk to your institution about how badly this project needs financial support.
Words really are the least one can give 🙏
I believe occupy max is slower than the new constraint yeah. It would be really a good thing if one can know which constraints are faster than which but I think in the end there are not many cases that you can solve with more than one constraint type so I think it is not that critical.
Maybe we could have something like constraint analyser in the future to detect possible conflict between constraints before generation.
Especially with those input files where it spends half the generation time on the last few activities.
I will be sending the files for your reference.
I would suggest that you make financial support at the fingertips of users.
I mean you may put your patreon, buy me a coffee ...etc links everywhere or at least in visible places in the app website or even the app itself as a reminder (that can be turned off if you like).
This would remind users more of supporting this great work and I would be the first to support!
I think this is a more sustainable way of getting support (by counting on the users) because most institutions are self-centered businesses and will just use the free versions.
Thank you again for your work and I hope you are rewarded for it the way you deserve!
All the best!
Thank you!
There are some tests done before the generation to check the feasibility, but it is impossible more than that. We need to try to generate to check.
Hello,
@pnlshd ,
We just released the new FET version, 6.9.4, with your constraint in it. Thank you for suggesting it!
Hello,
Congratulations! Thank you for all your efforts!
It has been a pleasure.
All the best 🙏