FET Forum

FET Support (English) => Get Help on Your Input File => Topic started by: mikkojoo on May 29, 2025, 07:58:33 AM

Title: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 07:58:33 AM
Hello!
I'm in a quite final state of making timetable. My main concern are uneven terms for certain teachers. I'm aware that this is because of other constraints - certain activities in certain terms or not in certain terms. Then there are other things too, like not many gaps per day or week.

Now the timetable takes 5-7 hours and I'd like have it ready today. So I need siome advise what I could try. For example "lyrpep", "kartar", some others too have difficulties with uneven workload.

So, whats wrong in mny file and what could I try?

This is a 5-term school, so 25 days, 5-terms, 4 hours a day.
Oh, it seems that my file is much too big...

Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 08:00:28 AM
Hello, Mikko,

You can pack (archive) your file and attach it here.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 08:19:43 AM
Hello, Mikko,

I received your email with your fet file.

I am not sure about "kartar", he seemed to have a balanced timetable, but indeed, for "lyrpep" I saw that he has a full first term.

Maybe you can use constraints of type "activities occupy min/max time slots from selection". Select all activities of "lyrpep", and add 10 constraints for him, 5 min, 5 max, selected slots = first term, second term, etc.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 08:22:30 AM
Thanks!
I found that myself too (always asking, not thinking...)
kartar is ok indeed now, but in the previous 150 versions she tend to have uneven terms

So you think that 10 is not too tight to try? I'll do that.

My file is noway secret, but just now I will go on!
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 08:24:21 AM
Sorry, you did not mean max 10, but 10 constarints :D
So busy not having time to read 8)
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 08:25:48 AM
Btw, is there anyway to make constraints as a batch, not making them one by one?
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 08:28:06 AM
Unfortunately, not. Only a FET code customization is possible, or another program to generate the XML fet file portion.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 08:51:20 AM
Maybe I should add in the TODO the constraints of type teacher(s) min/max hours per term.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 09:02:41 AM
Now I have a problem. There is something wrong and I cant find what. Many constraints, too many...

This is what I got now

Please check the constraints related to following possibly problematic activity (or teacher(s), or students set(s)):
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Id: 1960 (    1/6 - kilann,kulout - B1RU - RU - 7A,7B)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 09:11:35 AM
Oh... X (red) is selected. You made inverse!!!

Please edit the last 10 constraints, and click "Toggle all" in each and OK.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 09:15:42 AM
Baaaad! Thanks.

Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 09:22:11 AM
Now I realize why those colors are not always good. Green makes me think thats ok
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 09:40:12 AM
Quote from: Liviu Lalescu on May 29, 2025, 08:51:20 AMMaybe I should add in the TODO the constraints of type teacher(s) min/max hours per term.

Certainly that would make life easier as a 5-term timetable maker for 50+ teachers
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 09:56:00 AM
Yes, I agree. I added this in the TODO and I will think of it for the future. If I find sponsors, I will do it rightaway. My price for this feature is 1,600 (one thousand six hundred) euros.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 01:18:14 PM
Hello, Mikko,

I just obtained, after a bit less than 4 hours, two solutions (I generated on 8 threads). I attach them.

PS: Neglect new version warning, 7.2.4 is only on my hard disk for now, and you can open with the current official 7.2.3.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 04:45:50 PM
Quote from: Liviu Lalescu on May 29, 2025, 09:56:00 AMYes, I agree. I added this in the TODO and I will think of it for the future. If I find sponsors, I will do it rightaway. My price for this feature is 1,600 (one thousand six hundred) euros.

Sounds fair. I have to find some time to inform principals in Finland about FET. I find it super. It works the way I think and it makes things manageable.

Unfortunately it's not possible for me to support you financially. Things go so, that municipality decide what to buy and I can only tell my opinion. Maybe I can tell it louder.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 04:50:07 PM
Thank you!

I thought and I might try these even without sponsors. They are useful.

So, teacher(s) max/min hours per term, 4 types of constraints. The min will have a check box, "Allow empty terms".

Is this needed also for students?

How about the min (for teachers) - is it useful? What do you think? And with the check box allowing empty terms?

Will you be able to test? I might have tomorrow evening a working version, if I move fast. I can do my own tests, but I prefer to see the real life in action.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 05:19:15 PM
[quote
So, teacher(s) max/min hours per term, 4 types of constraints. The min will have a check box, "Allow empty terms".

Is this needed also for students?

How about the min (for teachers) - is it useful? What do you think? And with the check box allowing empty terms?

Will you be able to test? I might have tomorrow evening a working version, if I move fast. I can do my own tests, but I prefer to see the real life in action.

[/quote]

Not needed for students in our system. We only want that they have at least 3 lessons a day, nothing more is needed. Timetable is so full that it dosn't need more constrains.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 05:22:50 PM
Min for tearhers in  maybe needed, when a taecher has only few activities.
I'm trying to have this done today, but I certainly will test ýour new constrains  immediately.  If it gives better results its possible for me to make new one on Saturday/Sunday
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 05:29:39 PM
One simple question:
If a teacher has for example 75 activities on the wholwe year, what could be the proper min and max for one term?
Or when teacher has 62? Or 82?

75/5 = 15 (min 12, max 17????)
62/5 = 12,4 (min 10, max 14????)
82/5 = 16,4 (min 15, max 19????)
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2025, 05:37:55 PM
Quote from: mikkojoo on May 29, 2025, 05:29:39 PMOne simple question:
If a teacher has for example 75 activities on the wholwe year, what could be the proper min and max for one term?
Or when teacher has 62? Or 82?

75/5 = 15 (min 12, max 17????)
62/5 = 12,4 (min 10, max 14????)
82/5 = 16,4 (min 15, max 19????)


The question is unfortunately not simple. You need to start with higher max and lower min, and strengthen them as you find timetables. You know better than me (practically).
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2025, 05:43:41 PM
Ok, thanks. Simple question and answer is not. Agreed.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 30, 2025, 10:16:34 AM
Mikko, the variant with "min" is very complicated. I think I will do only the "max" variant, hoping it is the most important and useful. I will let you know when ready. The most important and difficult part is done, the generating code, but now comes the tedious part of the interface.

What do you think about "min"? Is it not important?
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 30, 2025, 02:36:58 PM
Dear Mikko,

I did the max. Please let me know. I hope to release maybe in a few days.

The link to test the snapshot is: https://lalescu.ro/liviu/fet/download/test/

Thank you for the suggestion!
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 30, 2025, 03:20:45 PM
Quote from: Liviu Lalescu on May 30, 2025, 10:16:34 AMMikko, the variant with "min" is very complicated. I think I will do only the "max" variant, hoping it is the most important and useful. I will let you know when ready. The most important and difficult part is done, the generating code, but now comes the tedious part of the interface.

What do you think about "min"? Is it not important?


Yes, the problem is always too crowded terms. If that is sorted out, there is no need for min, because activities are more even with just "max". A teacher with very small amount of activities, the first problem can be "min" but it can be handled with "max".
And, too many constraints will be a mess. It already is, for me.

But this max will make things much easier.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on June 02, 2025, 11:39:39 AM
The new official FET version, 7.2.4, with max, is just released now. Thank you, Mikko, for suggesting it and testing it!
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 15, 2026, 01:33:13 PM
Hello again!

Now I have opposite problem: I would like to have less activities  for a teacher in 5th term. So, other terms 1st- 4th more activities and less in 5th term.

What constraint would be suitable for this? How about "A teacher occupies max sets of time slots in selection" (I did not understand a bit of the explamation in that).

Please help us poor people!

BR Mikko
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 15, 2026, 02:08:12 PM
Hello, Mikko!

Please use activities occupy min/max time slots from selection.

A teacher occupies max sets of time slots from selection is for other things. Like selecting 3 sets of time slots and saying that max 2 of them could be occupied.

Liviu.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 17, 2026, 03:49:43 PM
Thanks again, also explaining that other constraint.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 17, 2026, 03:55:42 PM
You're welcome!

Occupy max might be faster than occupy min in your case: the activities are the same, but the time slots are 4 times more for min; the constraint has the times as QSet-s and checking if the current activity is in a selected slot is O(1), but the current activity will be in a selected slot 4 times less in max than in min; also, occupy max might be more efficient than occupy min in general (but I am not sure).
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 22, 2026, 09:47:11 AM
Thanks for that! Worked out.


New problem: Weight is now 95% at it makes huges problems with our complicated timetable. Two activities on same day is not suitable at for our school. So the weight should be 100%. Is there any other than change every constraint one by one from 95% to 100%?



Time constraint
Minimum number of days between activities
Weight (percentage)=95%

Number of activities=6
Activity with id=184 (1/6 - aapkat,riipäi,kulout - A2RU+B1RU - 7A,7B)
Activity with id=185 ( 1/6 - aapkat,riipäi,kulout - A2RU+B1RU - 7A,7B)
Activity with id=186 ( 1/6 - aapkat,riipäi,kulout - A2RU+B1RU - 7A,7B)
Activity with id=187 ( 1/6 - aapkat,riipäi,kulout - A2RU+B1RU - 7A,7B)
Activity with id=188 ( 1/6 - aapkat,riipäi,kulout - A2RU+B1RU - 7A,7B)
Activity with id=189 ( 1/6 - aapkat,riipäi,kulout - A2RU+B1RU - 7A,7B)
Minimum number of days=1
Consecutive if on the same day=yes
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 22, 2026, 09:54:03 AM
Very easy: go to the specialized min days between activities constraints and select the needed constraints and click "Modify selected" or "Weights". Also, in the all time constraints' dialog you can change the weights to a selection ("Weights").
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 22, 2026, 11:05:59 AM
Yes, I found that myself too. Thanks!
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 22, 2026, 11:09:26 AM
You're welcome!

I would recommend you to try with 99.75% first, or 99.9%, or 99.99%. If you have an impossible constraint of this type, it will be broken, and you can check things. If the constraints are possible, it is very probable that the final timetable will respect these 99.75%, 99.9%, or 99.99%.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 22, 2026, 01:17:34 PM
Thanks!!!!
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 11:51:19 AM
New problem: We have a constraint "min 3 hours per day" for all students.

But we have certain activities with tag "R", they must bedin or end groups day (because all students don't be in that activity, these are subjects like religion).

How can we have this  "min 3 hours per day, not including activities with R-tag"?
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 25, 2026, 12:05:14 PM
Please consider:

1) There is a constraint activities begin or end students' day;

2) You have a constraint students min hours daily with activity tag. You can add another tag to the other activities (with a single click);

3) You could divide a year by categories, and have two students groups: who have that activity, and who don't have, and constrain both groups to have zero gaps.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 12:16:33 PM
Yes, thanks!
We have that R for begin/end, but we could have another tag for activities for all group members  - so inverted R for that group?
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 12:42:35 PM
How about "min hours daily with an activity tag for a student set"? It sounds fine but I don't know how to use it?
- tag ALL
- days?
- hours?
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 01:01:15 PM
I tried this for all students, 3 hours, 5days.
I got:
"Cannot optimize, because the constraint of type activity tag ALL min 3 hours daily relating to subgroup 7A Automatic Subgroup requires at least 15 hours of work per week, but the activities of this subgroup with this activity tag sum to only 12 hours per week (the constraint requires 5 nonempty days). Please correct and try again"

Its because there are so many of those R-tag end/begin activities?
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 25, 2026, 01:08:33 PM
Maybe you could attach your file, and I'll see it home, a bit later.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 25, 2026, 02:08:38 PM
Maybe you need to add the tag "ALL" to all the activities?
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 07:34:29 PM
Sorry, been busy...
Here is my latest file. It's getting really complicated. So many big objects.

So, I have that R-tag for begin/end; ALL for all others (R inverted). No

If you had any tips or advice, I'd be grateful. There were many difficulties already, sorted out one by one. Now it seems quite ok, but there are some  {activity + activity+ R-activity} or maybe even {R-activity + activity + R-activity} situations.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 25, 2026, 07:59:21 PM
I added a special tag ("liviu...", last tag) to all activities without "R" tag, and a constraint students min 3 activities with tag "liviu..." per day, with minimum required number of days with tag = 0. It might be more efficient if you make minimum required number of days with tag = a logical value, greater than 0.

I attach the file. I might give it a try on my computer, but seems difficult.

Note: ignore the warning for new version FET-7.8.6, it is only on my hard disk, for now.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 08:06:52 PM
Maybe I understood something?
I have a constraint "min hours daily with activity tag KOKO for all students" == 3, days 25.

It seems to work, at least it does not stop

Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 08:07:49 PM
I'll check your file now, thanks
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 08:12:29 PM
So, I,m having just the same constraint as you. I only put days == 25, so it covers all days in our 5x5 days week.

It it solves, everything is ok with this. And if not, I will try something lower. Ok?
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 25, 2026, 08:12:50 PM
Yes, I think like you; it might be more efficient if you make min days = 25, rather than 0, as me, if all days are supposed to be non-KOKO-empty.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 25, 2026, 08:13:44 PM
Yes, I think so.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 25, 2026, 08:15:45 PM
Thanks again!

I'm having 1242 out of 1558 in 2min 25s. It seems to solve, maybe in two hours I'd say.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 25, 2026, 08:17:49 PM
I am generating on 8 threads, max is 1232/1558 after 30 minutes. So, it might solve. I am generating on the 0 min occupied days, because I want to check the behavior of FET.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 26, 2026, 05:29:31 AM
I left it overnight. It generated, I attach the archive.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 26, 2026, 02:42:03 PM
Thanks, same here.
We got quite good timetable. Anyway, we decuded to have

max activities with tag KOKO = 2, days =25
and
min hours daily for all students =3

So, we can have R-activity in beginning and/or end AND min 2 KOKO activities in the middle. So all students will always have min 2 KOKO activities and possibly R-activity in both ends
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 27, 2026, 06:47:35 AM
Good morning!
It seems to me that some constraints get broken, which is quite obvious with this file, but it does not give eny information about that in result statistics. Just wondering this.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 27, 2026, 06:58:24 AM
Good morning!

Please share the locked file (file_data_and_timetable.fet), and tell me where do you think it is a bug (the broken constraints)! I'll check.

Do you mean constraints with weight less than 100% are broken and not reported in the soft conflicts, or constraints with weight 100% which are broken? What type of constraints?
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 27, 2026, 10:55:23 AM
Hello again!

I think I know your problem, because I checked your file and saw it. It is a feature, not a bug: you have 50% subject preferred room, generate first time on the unlocked time, and you have one such broken constraint (for activity A, which has no room). Then you generate again on the locked file - this is where the feature appears: FET will allocate this activity A to a good room, respecting the constraint of preferred room, because it finds that this room is free for A at A's time.

The reason is that during the first computation FET will swap activities and not try again to place A in a good room. The locking does not add any preferred room for A, but generating on a locked file will allow A to be placed in a suitable room, if possible.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 28, 2026, 03:18:02 PM
We have quite good timetable, some final editing still with constraints (mainly about teachers not available times).
It seems that we always get one 8th grade FY or KE not according to constraints:
max 2 terms (ok)
max 3 hours (ok)
max days between 9 (not) - to keep in two terms, no empty terms between
In this one FY 8D has an empty term between two terms. It is something with the constraints or/and complexity of the file, because the problem stays but group changes in every generation.

This is no big problem, just wondering why this happens.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 28, 2026, 03:51:06 PM
I will check now.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 28, 2026, 04:03:49 PM
No, Mikko, FET is right. You added max 10 days between those activities, and consider that it can be in day 1 and day 11; also, these days may be not first of each term.

I think you need to use max 1 terms between activities.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 28, 2026, 04:22:20 PM
Ok, thanks.
So, one between does not mean 'one empty between'?
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 28, 2026, 04:28:18 PM
No, "between" means the difference, similar to min/max days between activities.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 28, 2026, 04:49:34 PM
OK, thanks
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 28, 2026, 04:50:32 PM
Sorry for the wasted time!
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2026, 07:23:20 AM
Please tell me, Mikko, did you click the Help button and read the help for this constraint (max terms between activities), before adding the constraints in your file? I am intrigued that my words there didn't make this clear.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2026, 09:08:09 AM
Sorry to disturb and make your life inconvinient!
I'm not sure when I last time read the help etc, but that "terms between" was hard to understand for me. I was always wondering "between what?" - furthest apart activities or empty terms between occupied terms.
Now I understand it!

Btw, if I put 'max terms between = 0' is it same as 'activities occupy max terms = 1' ?
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2026, 09:09:49 AM
Now I have changed all those my silly constraints to this, generated and it works so fine.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2026, 09:23:20 AM
Yes, I think the behavior is the same for max terms = 0 and occupy max 1 terms.

About your "between what" question, I put there a "Help" button (I mean it is already there in FET-7.8.5) and I hoped that explanation was enough/good.
Title: Re: Terms more even for a teacher
Post by: mikkojoo on May 29, 2026, 09:42:51 AM
Yes it sounds good to me now, but hard to say if I would understand it without this learning curve :D
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 29, 2026, 09:44:44 AM
I'll add your suggestion to improve this Help message in the TODO.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on May 30, 2026, 06:16:01 AM
Hello again, Mikko,

I added more help there. Could you please tell me if the following text is correct? :

"The exact behavior of this constraint is this: for each pair of activities (A1, A2) of this constraint, we compute the term distance between them (subtracting the term number of activity A1 from the term number of activity A2, assuming that A1 is scheduled earlier in the week compared to A2), and this distance must be less or equal than the specified value of max terms between activities of this constraint. For instance, if we have 5 terms per week, and activities A1, A2, and A3 scheduled respectively in the terms number 1, 2, and 4, the term distance between A1 and A2 is 1, the term distance between A2 and A3 is 2, and the term distance between A1 and A3 is 3. If we specified max terms between activities for a constraint of this type = 2, this constraint is broken, and FET will reallocate the activities. If we specified max terms between activities for a constraint of this type = 3, the constraint is respected and FET will allow the current schedule."
Title: Re: Terms more even for a teacher
Post by: mikkojoo on June 08, 2026, 08:54:43 AM
This very good! Thanks again.
Title: Re: Terms more even for a teacher
Post by: Liviu Lalescu on June 08, 2026, 09:15:28 AM
Thank you, as well!  :)