some ideas for future versions

Started by ggscuola, September 23, 2023, 12:16:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



first of all, thanks a lot for your work.

I would like to suggest some ideas for possible future implementation.
I apologize in advance if the suggested options have already been discussed.

1) All teachers/A teacher start(s) the day in a specific building. [end(s) the day in a specific building].
2) All students/A students set cannot have two specific subjects on the same day.
3) All teachers/A teacher work in a hourly interval min days per week (there is MAX option in current version).


Liviu Lalescu

Hello, Giorgio,

Thank you for your interest! I added your words in the TODO file.

(2) - I think this can be easily solved with min days between activities or students activity tag max hours daily.

(3) - I think this can be solved with activities occupy min time slots from selection.

About (1) - yes, this is not possible currently without a new constraint. I am not sure, is it really a universally needed to be added constraint? If so, I could add it in the official FET, if not, I could make a custom version.

Unfortunately, as I have written in more places, it is very hard to live from free/libre software. There are few donations. I would be ready to add this constraint if sustained financially by a kind of sponsorship contract or work contract.


Quote from: Liviu Lalescu on September 23, 2023, 10:01:59 AM(2) - I think this can be easily solved with min days between activities or students activity tag max hours daily.

Thanks for your answer.
Regarding point (2), perhaps I did not understand your bypass solution.
If I have multiple teachers teaching the same subject (with a lot of students sets and sub-activities) and I don't want students to have English and French, Arts and Tech, Music and Sport activities on the same day, it would be hard to set up "min days between single activities".
And I don't see how "max hours daily" could work either, because some teachers teach the same subject 1 hour with a set of students and 2hours with other sets.
Plus, some days last 6 hours, some days last 5, 7 or 8 hours... Some students go to school on Saturdays and others don't. So I cannot set hours between activities for all the teachers and students sets.
That's why I was suggesting a possible new constraint which would avoid that two chosen "subjects" (or tags) fall on the same day.

Liviu Lalescu

You are welcome!

(2): If it is assumed that there are no two activities of English on the same day, and no two activities of French on the same day, you can add all the activities of English and French, 100%, min 1 days between them.

If not, I just thought of another trick: use two constraints students min gaps between ordered pair of activity tags, min gaps = n_hours_per_day. One from French to English and one from English to French. Please let me know if this works for you.


Thanks Liviu!  :)

Well, if I add all the activities of English and French that would limit the possibilities.

The situation is complicated. English is 3 hours/week, French is 2 hours/week. Some English teachers want their hours in 2+1 mode, others 1+1+1; some French Teachers want their hours like 1+1, others want 2 hours together.

Let's say in Students set 1, Teacher A teaches English and Teacher B teaches French.
In Students set 2, Teacher A teaches English, Teacher C teaches French.
In Students set 3, Teacher D for English, Teacher B for French.
I cannot add ALL Eng and French sub-activities and set min 1 day between them: First, I have hundreds of activities. Second, there is no need to set distance between, say, French Teacher C and Eng teacher D and, if I add it, that would add some unnecessary constraints. Thus, I would have to set constraints for every Students set and, for every set, carefully do that with matching Teachers only.
Even when the two Teachers are the same for two Students sets, there is no need to add distance between activities of Teacher A in Stud set 1 and Teacher B in Stud set 2 (or between Teacher A's activities in Stud set 1 and 2).
Oh, and don't forget the other things: Arts vs. Tech, Music vs. P.E. ...  ::)
I hope I was clear.  :o

Regarding the second trick, students min gaps between ordered pair of activity tags, min gaps = n_hours_per_day, I have found that in another forum thread.
I don't think it would work since some Stud sets have 5 hours-day, other sets have 6 or 7, 8 hours-days and for some Stud sets the hours number changes between weekdays! (i.e., Monday 8h, Tues 7h, Wed 6h, Thu 8h, etc.).

... That's why I kindly suggested the implementation of "All students/A students set cannot have two specific subjects (tags) on the same day".  ;)
Thanks for reading this.

Liviu Lalescu

Dear Giorgio,

I think you can use both approaches.

1) Min days between activities: take all the English and French subactivities of a specific students set and min 1 days between them with 100%. If the English teacher wants for his students set 2+1, add English subactivities 2,1; if he wants 1+1+1 add the subactivities 1,1,1. You have many constraints to add, I admit. Filter by the students set, English, add all activities, French, add all activities. This only does not work if say English is 1,1,1 95% and you prefer 1+1+1 but you allow 2+1 (in 5% of cases).

2) The trick with min gaps between ordered pair of activities works as well. You just add the maximum allowed, which is n_hours_per_day. If the activities are on different days it is OK, it is allowed for English last hour on Wednesday and French first hour on Thursday.

Please let me know.


QuotePlease let me know.

Tried both approaches and attempted to generate a timetable at least 100 times for each one.
With the first approach, FET could never complete any timetable.
With the second one, FET was able to complete the timetable just twice. One version came out with minor problems and might work fine; I discarded the second one because of too many conflicts.

So (of course) you were right and it looks like the software is capable to do what I was asking.
It is just a little complicated to accomplish it, especially if your school has many teachers/stud sets/time schedules.

The fact that in my case it cannot complete the generation is probably due to the (too) many additional constraints I applied for teachers and students sets.

Thanks for your assistance!

Liviu Lalescu

You are welcome!

Maybe in the first approach you made mistakes, because of adding many constraints, and that's why it was impossible. Or it was luck. Or: you might allow 95% for English, but you added 100% for English+French.

If you have multi-core computer, you can generate multiple on the number of cores you have = FET threads. If you have 8 core computer, generate multiple on 8 threads, it will generate 100 timetables approximately 8 times faster overall.

Liviu Lalescu

Quote from: ggscuola on September 23, 2023, 12:16:12 AM1) All teachers/A teacher start(s) the day in a specific building. [end(s) the day in a specific building].

Hello, @ggscuola ,

I just wanted to tell you that I thought of your suggestion and tried to implement it in the official FET, but unfortunately it seems too difficult. Maybe as a customization which will be implemented not perfectly it might work, but it looks very difficult. If I will have some more time and you need a customization, I could try to make this one for you completely for free - just let me know.


Sometimes I add constraints, resulting in an unscheduled schedule, but don't remember what the last constraint was.
- I want a binding change history
Thanks very much !

Volker Dirr

If you added constraints, then it is easy: Just open the constraints list. It is ordered chronological.

If you modified it, then you can't see it, that is true.
In normal case the timetables should solve very fast, so you can remeber.
But you are right, if you do the last optimizations, then it might generate a long time and you might forget what you have modified. In that case i normaly save the file with an added hint in the file name like "_teachers_gap_2" or i write it in the comments.

hmm... implementing an UNDO feature is sadly difficult.
Except if we do it like this: If you modify an constraint, then it won't be modified, but it will be deleted and added again. Not a "nice" design, but by this the constraints will be always sorted by time.
Sadly for activities the problem is very similar, but can_'t be solved by this trick always, since constraints might be deleted as soon as you delete an activity.

Your suggestion is already an the TODO, but we don't know yet how to implement that feature well. So it might take some time to implement it.

Liviu Lalescu

Thank you, @pekuon , for suggesting it! It is suggested by more users, but unfortunately it is very complicated, tedious, and risky for the data.