FET Forum

FET Development => Suggestions => Topic started by: Benahmed Abdelkrim on February 28, 2026, 11:14:18 AM

Title: min activities in a building
Post by: Benahmed Abdelkrim on February 28, 2026, 11:14:18 AM
Hello Dear Liviu!
I've been working on an exam timetable using FET-NSRT. The requirement is to ensure that each building has at least one activity during each time slot. The current space constraints do not allow it; therefore, if you wish, I suggest adding this space constraint::
min activities in a building.
Title: Re: min activity in a building
Post by: Liviu Lalescu on February 28, 2026, 11:27:39 AM
Hello, dear Benahmed!  :)

I will think of this. Could you please send me your fet file?
Title: Re: min activity in a building
Post by: Benahmed Abdelkrim on February 28, 2026, 11:30:08 AM
Here it is ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on February 28, 2026, 01:44:10 PM
I made something: https://lalescu.ro/liviu/fet/download/custom/nsrt/

But I don't like it. It is always forcing an activity in each nonbreak slot for each building (the constraint is hardcoded). It is not nice, it is not efficient.

I would highly recommend you to give up this NSRT and we should think of other procedures to schedule the exams with the new FET and new methods/tricks. I am ready to try this, if you want.

The current custom version works, anyway, so you can use it. I tried it practically on your unlocked file.
Title: Re: min activities in a building
Post by: Liviu Lalescu on February 28, 2026, 04:14:10 PM
Forgot:

1) In your file, the home rooms constraints are all ignored, because preferred rooms override home rooms on each activity.

2) My solution assumes that each activity can be in any room.

3) My solution assumes that each activity has duration 1.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on February 28, 2026, 05:14:16 PM
Thank you very much, the new version works perfectly.
I made some improvements to the file. I removed the home constraints and replaced them with preferred rooms constraint activity tags.
The file is attached bellow.
Title: Re: min activities in a building
Post by: Liviu Lalescu on February 28, 2026, 05:33:38 PM
You are welcome, dear Benahmed!
Title: Re: min activities in a building
Post by: Liviu Lalescu on February 28, 2026, 07:50:29 PM
I have thought about it. If this NSRT is really useful, I could update to FET-7.7.7 and add proper constraints instead of constraints through comments. Just let me know if you need this.

For the moment, I am not feeling too well, but I hope I can help you maybe later with the above, if you consider we need to do it.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on February 28, 2026, 10:16:09 PM
Quote from: Liviu Lalescu on February 28, 2026, 07:50:29 PMI have thought about it. If this NSRT is really useful, I could update to FET-7.7.7 and add proper constraints instead of constraints through comments. Just let me know if you need this.

For the moment, I am not feeling too well, but I hope I can help you maybe later with the above, if you consider we need to do it.


Thank you, dear Liviu, for your help. It would be very beneficial and useful if we did things correctly, better than they are now.
Take your time, Liviu... I wish you health and happiness.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 01, 2026, 07:16:22 PM
Thank you for your kind words, Benahmed! I will think of the possibility of improving this custom version, NSRT, to FET-7.7.7, and adding constraints instead of comments. I will write here, asking you for ideas, when and if I will be able to do this.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 01, 2026, 09:06:12 PM
Thank you Liviu
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 04, 2026, 03:32:24 PM
Dear Benahmed,

I did some things:

1) Updated to FET-7.7.7-NSRT.

2) Added a new constraint building(s) min one activity in each non-break time slot percentages.

The other constraints remained in the comments section, and for the new constraint (2) the data set must have all activities with duration 1 and only real (not virtual) rooms.

This is all I did for the moment. Please let me know what you think!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 03:56:43 PM
Thank you, dear Liviu, for this update. I'll give my opinion in a moment...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 04, 2026, 03:59:43 PM
You are welcome! No big hurry, I'll wait.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 05:00:39 PM
Thank you very much for adding this new constraint; it works perfectly. I will translate it soon...

By the way this new NSRT version reflects a new way of inputting data, which consists of entering rooms and teachers as they are, without swapping them as we did in the earlier versions of NSRT.

This way allows us to disregard three constraints: MHPD, MHPW, and MSPD, since all these constraints are already implemented in FET. We only have one remaining constraint for FET-NSRT to become a complete and ideal version; as a reminder: MTR (max teachers repetitions).

Also, this version, which reflects a new method of data entry, does not require virtual rooms and only uses activities lasting one hour, as you can see in the last example downloaded above.
In summary, this latest version only requires implementing the MTR constraint. The others can be left as they are in the comments while users familiarize themselves with this simple and easy method...

Alsov if you have some time, allow me to suggest adding the buildings to the FET interface...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 04, 2026, 05:20:18 PM
You are welcome, Benahmed  :)

The new constraint is not of my liking (building(s) min one activity in each non-break time slot), because it is not very efficient in speed. But, if it works practically, even if slower, it is good. You can see for your latest example that it works slow, because it takes on my computer sometimes even about 5 seconds to go from one iteration to the next (updating the elapsed time).

I will try to implement the MTR in the interface, soon. For now I don't even know or remember this option, but I will read and try it, soon, as I said.

Do you mean adding in Space constraints a Buildings section?

I am not sure if I will begin working this evening or tomorrow, or even later than that. I will write here.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 05:32:49 PM
Thank you!
The slowness of generation is not a big problem in exam timetables. besides on my computer the most complicated file even with old versions does not exceed 5 min, a little more or less...

QuoteDo you mean adding in Space constraints a Buildings section?
Yes, if possible; otherwise, we can surpass it...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 04, 2026, 05:40:52 PM
Began work. Maybe in 3-5 hours ready, or tomorrow, hopefully.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 05:43:59 PM
Quote from: Liviu Lalescu on March 04, 2026, 05:40:52 PMBegan work. Maybe in 3-5 hours ready, or tomorrow, hopefully.

I am very grateful, dear Liviu.  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 05:49:15 PM
Regarding the translation, it's up to you; we can do it before or after the release. Let me know your choice.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 04, 2026, 05:56:41 PM
I will put a version, and you can translate, then I'll update the final version to be perfect in Arabic.

In other words: I'll release fet-7.7.7-nsrt2, you'll update, then we will release fet-7.7.7-nsrt3 with perfect Arabic.

If you really want, we can release finally with name fet-7.7.7-nsrt (reverting the name). This is not quite nice, because some users might already have this version.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 05:58:45 PM
Quote from: Liviu Lalescu on March 04, 2026, 05:56:41 PMIn other words: I'll release fet-7.7.7-nsrt2, you'll update, then we will release fet-7.7.7-nsrt3 with perfect Arabic.
it's OK!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 04, 2026, 08:29:27 PM
It is ready, please check!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 08:30:40 PM
I have updated the translation. The file is attached below...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 04, 2026, 08:37:40 PM
I just updated your file to nsrt2 and sent you by email. Too large for the forum.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 08:59:07 PM
I just updated the ts file. it's attached below
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 04, 2026, 10:53:06 PM
Another suggestion is to allow the viewing of buildings timetables in different formats via the FET interface: horizontal days, vertical days and horizontal times... ofcourse if possible and if time permits 🙂
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 05, 2026, 05:54:38 AM
I just put the final NSRT version.

About buildings timetables - this is too difficult, because a cell may contain more activities. But I will add this in the TODO list.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 05, 2026, 07:05:21 AM
Thank you so much, dear Liviu, I am very grateful for your help. I will share this good news with other users this afternoon...  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 05, 2026, 07:49:03 AM
You are welcome, dear Benahmed! 🙂
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 10:57:13 AM
Hello!
Could you please take a look at these two files? One has the building constraint: minimum 1 activity, and the other doesn't. However, the generation speed and behavior are not the same. There's a 50-second difference (T_without constraint=5s, T_with constraint=55s. The random seed used is the same.
The 2 generated timetables are identical!

s10=1, s11=1, s12=0,
s20=1, s21=1, s22=0.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 12, 2026, 11:05:11 AM
Hello, Benahmed,

I will have a look at your files a bit later (now I am compiling a snapshot). However, as I told you, the new constraint min 1 activity in a building is very slow. Maybe by luck you obtained without the constraint a solution, and then adding the constraint makes things much slower.

The finishing random seeds are the same?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 11:26:18 AM
Quote from: Liviu Lalescu on March 12, 2026, 11:05:11 AMThe finishing random seeds are the same?
Yes, they are the same?!

s10=2243316414, s11=4198963596, s12=1764949901,
s20=1050249024, s21=2683648393, s22=2170710787.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 12, 2026, 11:51:31 AM
Yes, Benahmed, I checked also on my computer, the same. So, with the new constraint it is 10 times slower... :(

I apologize, but I cannot make the new constraint faster. It is checking very much information when running.

I am sure that if you find a solution for the "without" file, which does not respect the min hours new constraint, the behavior and the final seed will be different for the "with" file, but of course much slower on average.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 01:09:20 PM
Quote from: Liviu Lalescu on March 12, 2026, 11:51:31 AMYes, Benahmed, I checked also on my computer, the same. So, with the new constraint it is 10 times slower... :(

I apologize, but I cannot make the new constraint faster. It is checking very much information when running.

I am sure that if you find a solution for the "without" file, which does not respect the min hours new constraint, the behavior and the final seed will be different for the "with" file, but of course much slower on average.


 Can we add a note warning the user that this constraint is not fully optimized and significantly slows down generation, indicating that this constraint requires improvement...?
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 12, 2026, 01:19:33 PM
Oh, sure! Please let me know if you have the exact English suggestions - otherwise I'll add mine.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 01:58:29 PM
Suggestion: This constraint has not been fully optimized. It can slow down generation; use it only when necessary and when required.
You can modify it or suggest another sentence.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 12, 2026, 02:02:16 PM
OK, I will do, and update to FET-7.8.0. Please write below the Arabic translation of this field:

---
This constraint has not been fully optimized. It can slow down generation; use it only when necessary and when required.
---
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 02:18:37 PM
هذا القيد لم يتم تحسينه بشكل كامل. يمكن أن يؤدي استخدامه إلى تباطؤ الإنتاج؛ استعمله للضرورة وعند الحاجة فقط
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 12, 2026, 03:15:40 PM
It is ready.

I wish to deeply apologize to Benahmed and to the Arabic users of FET-NSRT for the fact that the new constraint is so slow! In my defense:

1) I did not know it is that slow. I warned it was slow, but I did not know that it is so much slower.

2) It is a research problem. We cannot guarantee each time perfection.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 03:29:11 PM
Thank you very much, dear Liviu!
   We hope it will be better in the future. Until then, it can be used, but with patience, or by using some tricks, like the one I used, which is dividing the teachers into groups, each group teaching a different subject, as shown in the example above (labeled "without").
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 12, 2026, 03:36:29 PM
You are welcome, dear Benahmed, and thank you for your understanding!

I saw your "without" file, but I don't understand the trick, sorry. But it is no problem.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 06:06:27 PM
The trick used to avoid slowing down generation and to avoid using this new space constraint specific to buildings is to follow these steps:
1.   Add a number of pseudo rooms equal to the number of real rooms. Each building should consist of one real room and one pseudo room. For example, building R1 consists of one real room (R1) and one pseudo room (r1).
2.   Add two subjects, sub1 and sub2
3.   Choosing the mode: morning – afternoon
4.   Imagine a synoptic diagram of the solution: The week consists of 5 days, the number of time slots available in the morning and afternoon, Morning-afternoon behavior of teachers (exclusive, unrestricted, exceptions...)
5.   Calculate the activities to be placed in the real rooms: Number of real rooms X Number of available time slots per week.
6.   Calculate the total number of activities:
Number of half-days worked/Teacher X Number of available time slots / each half-day X Number of teachers
7.   Calculate the number of activities placed in pseudo rooms: Total number of activities – Number of activities in real rooms
8.   Enter teacher activities as mentioned above.
9.   Enter time constraints
10.   Enter space constraints

The file attached below clearly illustrates these steps. ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 12, 2026, 07:15:59 PM
Probably a small mistake in your file. I attach a screenshot. The rest of the buildings seem OK.

But why should each building have at least one activity?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 07:33:26 PM
Thank you for the report. Yes, it was a mistake. Room R2 was assigned to building R1.
I have corrected it and reattached the file.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 12, 2026, 08:12:31 PM
QuoteBut why should each building have at least one activity?
A brief explanation:
If you've seen, each building represents a real room, and each real room can accommodate two teachers (in other cases more than 2). To avoid having a building without any teachers, each building (real room) is required to have at least one activity.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 04:22:45 AM
In the example attached above, we have 19 real rooms and 18 available time slots, so the number of so-called "real" activities is calculated by the following operation:
19×18=342 activities;

This number of so-called "real" activities must first be calculated and assigned to a set of teachers who teach the subject called "sub1" in order to guarantee that each real room (building) has at least one activity.
These "real" activities take place in the real rooms: R1, R2, R3, ...,R19

The total number of activities is calculated using the following formula:
each teacher is assumed to work 6 half-days/week, there are 2 available time slots/ half-day, and 40 teachers, therefore:
 the total number of activities = 6 × 2 × 40 = 480 activities

The pseudo activities are easily calculated using the following operation:
480 - 342 = 138 pseudo activities.

These pseudo-activities are assigned to a set of teachers who teach the subject, called "sub2", and take place in the pseudo rooms: r1, r2, r3, ..., r19.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 06:28:39 AM
Hmm... Benahmed, I think I understand. But this way you are kind of doing the timetable manually. You are restricting the teachers and choosing the building for them, instead of letting FET do that.

I think the slow min one hour per building is better, because it has liberty. It is slow, indeed, but it cannot be improved.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 08:43:46 AM
The speed has slowed down, It became a matter of hours! That's why I thought of this trick to optimize generation time and make it shorter. In a few seconds, sometimes 1 or 2 minutes, you can get a solution instead of waiting for tiring hours...

Yes, perhaps a manual solution as you described; letting the program freely choose the building is better, but sometimes we're impatient and should do things ourselves instead of letting the program do it, and guide it towards a faster solution...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 08:59:47 AM
But, Banahmed, why can't you use a constraint activities min n_buildings simultaneous in selected time slots?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 09:21:37 AM
Quote from: Liviu Lalescu on March 13, 2026, 08:59:47 AMBut, Banahmed, why can't you use a constraint activities min n_buildings simultaneous in selected time slots?

I didn't understand?
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 09:31:24 AM
A constraint activities min simultaneous in selected time slots (min simultaneous activities from a set in selected time slots). Min simultaneous = number of buildings, selected activities = all activities, selected slots = all without breaks, not allowed empty slots.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 09:52:15 AM
Quote from: Liviu Lalescu on March 13, 2026, 09:31:24 AMA constraint activities min simultaneous in selected time slots (min simultaneous activities from a set in selected time slots). Min simultaneous = number of buildings, selected activities = all activities, selected slots = all without breaks, not allowed empty slots.

I use this constraint, as you have seen in the attached files above, but it alone does not guarantee that each building receives at least one activity.

You can see the example illustrated in the attached file below...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 10:10:00 AM
I'll see a bit later. I'll try to think of a solution.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 11:23:37 AM
I'm trying to think of the best approach to your problem, Benahmed.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 11:40:48 AM
I have an idea to improve the new constraint buildings min one activity. I'll let you know. It is a bit complicated.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 11:45:49 AM
Quote from: Liviu Lalescu on March 13, 2026, 11:40:48 AMI have an idea to improve the new constraint buildings min one activity. I'll let you know. It is a bit complicated.

Good News! I wish you success!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 02:03:22 PM
Dear Benahmed,

It was difficult, but maybe I obtained a good speedup. Please check the new version, fet-7.8.0-nsrt2: https://lalescu.ro/liviu/fet/download/custom/nsrt/

Please let me know!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 02:33:57 PM
I'll test and report...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 02:43:43 PM
Please wait 10 minutes.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 02:44:26 PM
Quote from: Liviu Lalescu on March 13, 2026, 02:43:43 PMPlease wait 10 minutes.
OK!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 02:53:47 PM
I just put a new version, even further optimization. fet-7.8.0-nsrt3.

Please let me know!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 02:59:56 PM
I mean, it (fet-7.8.0-nsrt3) is ready for testing. (You might want to check a bit also old9a/nsrt2, but just a bit - it should be slower.)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 03:15:56 PM
I'm testing the attached file below with the same random seeds using the three latest versions: 7.8.0 nsrt, nsrt2 and nsrt3.
random seeds:
s10=3385507001, s11=3350186166, s12=3250444770,
s20=1795543818, s21=3245662932, s22=1143393762
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 03:18:01 PM
OK, I'll wait for your results (I might try it also myself a bit). nsrt might give a different seed at the end, nsrt2 and nsrt3 should give the same seed at the end.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 03:20:02 PM
with fet-7.8.0 nsrt, generation time= 8m 14s
with fet-7.8.0 nsrt2, generation time= 14m 42s
with fet-7.8.0 nsrt3, generation time= 8m 45s
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 03:23:20 PM
Quote from: Liviu Lalescu on March 13, 2026, 03:18:01 PMnsrt might give a different seed at the end, nsrt2 and nsrt3 should give the same seed at the end.
Yes, indeed.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 03:25:29 PM
You might want to generate multiple nsrt3. I attach my tests as screenshot.

I think it was bad luck in your test with nsrt2 and nsrt3, and luck with nsrt.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 03:25:43 PM
All three managed to place 452 activities in a few seconds, but struggled to place the last two.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 03:27:23 PM
Yes, indeed, so on mine. (I slightly modified my previous post.)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 03:40:37 PM
I did another thing, and I am waiting to compile, and I will think some more. I'll try on your latest example. Indeed, it has a bad behavior.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 03:53:06 PM
I tried multiple generation with nsrt3. I attach a screenshot...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 04:09:54 PM
I won't give up!!!  :)  I have another idea, I'll try now (again, complicated!!!).

I'll let you know.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 04:46:44 PM
We did it, Benahmed!!!  :)  I made a very nice optimization and difficult. I attach the screenshot.

I will compile Windows and put nsrt4 in 20-30 minutes.

Please stay tuned.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 05:01:20 PM
Thank you for your effort! you worked hard.
I hope the test will be successful this time.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 05:04:08 PM
You are welcome!

NSRT4 is ready. You can check it (please firstly check on the file you gave immediately above).
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 05:17:24 PM
Oh! Amazing! The test was successful. I tried it with the same file attached above, and with the same random seeds.
Time: 2min 37s

random seeds:
s10=3385507001, s11=3350186166, s12=3250444770,
s20=1795543818, s21=3245662932, s22=1143393762

Behavior has also improved significantly!

Thank you very much dear Liviu! We are very grateful; me and the arabic users for the great effort you have made to improve this NSRT version.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 05:25:50 PM
You are welcome! Thank you!  :)

I might have left some minor details unperfected, but I am too tired now.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 05:27:41 PM
I think the warning added yesterday is no longer useful given these significant improvements in production speed. What do you think?
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 05:33:12 PM
Sure! I'll remove it. I think soon.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 05:56:54 PM
I am doing it now, but there is a cosmetic thing of which I am not 100% satisfied... I might leave it this way, it works correctly in practice. I am not sure. Still thinking.

I hope it will be ready in maximum 30 minutes, so you can announce the new version.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 06:00:32 PM
Quote from: Liviu Lalescu on March 13, 2026, 05:56:54 PMI am doing it now, but there is a cosmetic thing of which I am not 100% satisfied... I might leave it this way, it works correctly in practice. I am not sure. Still thinking.
Take your time, there's no rush...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 06:29:34 PM
I just put the new version, fet-7.8.0-nsrt5. Please check that I removed the warnings in building(s) constraints (two constraints, singular and plural)!

The cosmetic thing needs to wait. I cannot decide on how to make it, I need time to understand the matter. If the program works in practice, it is a negligible thing. Like the difference from correctness 99.996% and 99.997%.

Please test the new version practically also with different sets of data, I might have forgotten some things! Test with different MTR=x (0 or 1 - I saw that your latest file contained only 0s). Also, I think each activity must have a room and a building, otherwise the program might not work or even crash. We might solve these if needed.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 06:42:08 PM
Sure! I'll test and report...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 07:18:20 PM
I started testing, but something caught my attention: with mtr>0, I think the behavior changed; time doesn't flow normally. The seconds jump from 5 to 7 to 10, etc., randomly. Is this normal? ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 07:24:13 PM
It can mean one thing: the MTR>0 implies that the generation is slower. The seconds are updated after a complete cycle. I'll have now a look at the MTR procedure to check. At the time I wrote that I was sure it is maximum optimized, but who knows?

I can tell you that with FET-official, there are many difficult files with this behavior. Some constraints take longer time.

The unoptimized fet-7.8.0-nsrt to fet-7.8.0-nsrt3 had about 5-10 seconds delay, if I remember.

Also, at the time of writing MTR, I thought it was quite inefficient, but could not improve it.

Could you tell me if the results are good, even with this "jump"?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 07:35:59 PM
The results are generally good, the constraints are respected, no errors... I think, as you said, it's because of the MTR; perhaps it needs to be checked...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 07:36:07 PM
I just watched the code. Indeed, it is different for MTR=0 and MTR>0.

I hope the code is optimized as it should be, I mean without possibility of improvement, but I might investigate tomorrow some more.

The files with MTR>0 solve correctly and fast enough?

As I told you, there are some (many?) official constraints/files with this behavior.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 07:38:10 PM
OK, I'll have a second look now at MTR and let you know.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 08:07:34 PM
Quote from: Liviu Lalescu on March 13, 2026, 07:36:07 PMThe files with MTR>0 solve correctly and fast enough?
Yes, no major changes except this jump; the speed is good, the results are acceptable. I think we should be satisfied with these good results.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 08:18:28 PM
No! We should not be satisfied! I will try to squeeze some more speed, but tomorrow morning - I hope it is not too late for you.

There might be room for improvement, as I had a look now at my old code.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 08:19:51 PM
Please send us your MTR>0 file which exposes this problem (here on the public forum).
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 08:32:33 PM
Quote from: Liviu Lalescu on March 13, 2026, 08:18:28 PMNo! We should not be satisfied! I will try to squeeze some more speed, but tomorrow morning - I hope it is not too late for you.

There might be room for improvement, as I had a look now at my old code.
Very good, let's continue ...

Quote from: Liviu Lalescu on March 13, 2026, 08:19:51 PMPlease send us your MTR>0 file which exposes this problem (here on the public forum).
 
Here it is

Tried with these random seeds, the generation time is very short = 39s:
s10=1773433512, s11=62939200, s12=0,
s20=1773433512, s21=62939300, s22=0.

Title: Re: min activities in a building
Post by: Liviu Lalescu on March 13, 2026, 08:35:16 PM
See you tomorrow early morning! Good night!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 13, 2026, 08:36:20 PM
Good night!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 07:29:20 AM
The new version, fet-7.8.0-nsrt6, is released. We managed to improve speed a bit, but under 10% from nsrt5 (the seeds should remain the same, you can compare).

I think this is the final one for the moment  :)

The behavior to jump seconds is normal.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 08:21:03 AM
I did a test with both versions, NSRT5 and NSRT6, and I assure you the results were significant. The time with NSRT5 was 4 minutes and 44 seconds, while the time with NSRT6 was 32 seconds! A BIG difference! The generation speed has improved considerably! I can confidently say that this latest version is the best of all!

The test is done with the following descriptions:
MTR=3
random seeds:
s10=123, s11=123, s12=123,
s20=123, s21=123, s22=123.
The random seeds at the end of the generation are not the same.

Thank you so much for this update which has brought improvements in speed and behavior.

The file is attached below ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 08:48:06 AM
No, dear Benahmed, it was only luck; the speed improvement is under 10%. The seeds must be identical to compare. Otherwise, you could generate many timetables and see the average.

I am tempted to add these two constraints in the official FET, but they are too specialized...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 08:57:51 AM
Quote from: Liviu Lalescu on March 14, 2026, 08:48:06 AMNo, dear Benahmed, it was only luck; the speed improvement is under 10%. The seeds must be identical to compare. Otherwise, you could generate many timetables and see the average.
yes the seeds are identical with the  both versions.

Quote from: Liviu Lalescu on March 14, 2026, 08:48:06 AMI am tempted to add these two constraints in the official FET, but they are too specialized...
 
it's a Good Idea! All FET users can take advantage of NSRT's features to create exam timetables.

Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 09:00:58 AM
To compare, the final seeds must be identical also.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 09:06:14 AM
Quote from: Liviu Lalescu on March 14, 2026, 09:00:58 AMTo compare, the final seeds must be identical also.
even though the two versions are not the same?!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 09:13:27 AM
Another test with a slightly different file. Generation time = 1 minute. The seeds are as follows:
s10=658647871, s11=2950353718, s12=1319523356,
s20=2607661595, s21=2963827883, s22=952463516.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 09:22:06 AM
Between nsrt5 and nsrt6 we only changed a bit. By chance, we obtained the same seed for your testnsrt5. But for other files, seeds are different. You need to compare 10 or more timetables.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 10:13:32 AM
I just arrived home. Writing from the cell phone is a bit more difficult.

I did not download your latest two files - should I? I admit I am a bit lazy to check  :)

I will add the suggestion to add the two constraints from NSRT in the official FET in the TODO and think of it. You know that I want the best for FET, and I am not sure such an addition is perfect for FET.

Are there many successful users of FET-NSRT? Is the problem solved by NSRT a common problem in Algeria?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 10:42:37 AM
Quote from: Liviu Lalescu on March 14, 2026, 10:13:32 AMI did not download your latest two files - should I? I admit I am a bit lazy to check  :)

If you want, especially the last file, it's a little different from the others, why not add it to the examples folder?

Quote from: Liviu Lalescu on March 14, 2026, 10:13:32 AMI will add the suggestion to add the two constraints from NSRT in the official FET in the TODO and think of it. You know that I want the best for FET, and I am not sure such an addition is perfect for FET.
I support this initiative; it would be very beneficial for FET and its users. The problems it solves are common in Algeria and Morocco, and even in other countries, as you can see from the reactions on social media.

I remember that users contributed to spreading NSRT through their contributions, helping to make NSRT easier to understand and use.
@YOUSSEF HOUIET
@Mubarak Mzili
... etc

This last user (Mubarak Mzili) even contributed through videos and an application to facilitate and explain the fundamentals of NSRT.

Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 10:54:09 AM
I added these last two examples on my hard disk to add as official examples in future NSRT versions. I did not test them - I am too lazy.  :)  If really needed, I can test them.

I will think.

PS: In the Custom versions section of the FET homepage, I made NSRT the first one. Please check the links!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 11:00:36 AM
Yes, I checked, that's very kind of you. Thank you so much dear Liviu!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 11:07:33 AM
Dear Benahmed,

The constraint building(s) have min one activity in each non-break slot - if we add it to official FET, the whole file should respect:

1) Each activity has duration 1.
2) Each activity can go to each building.
3) Each building should have at least an activity in each non-break slot.
4) No virtual rooms in the data.

and maybe other conditions I don't remember now.

Are these OK if we add to the official FET? We cannot make them more general.

We might add them now (the two custom constraints, rooms max repetitions and buildings min one activity) to the official FET. I am so excited about the latest results!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 11:29:07 AM
Quote from: Liviu Lalescu on March 14, 2026, 11:07:33 AMThe constraint building(s) have min one activity in each non-break slot - if we add it to official FET, the whole file should respect:

1) Each activity has duration 1.
2) Each activity can go to each building.
3) Each building should have at least an activity in each non-break slot.
4) No virtual rooms in the data.

and maybe other conditions I don't remember now.

Yes, absolutely, these are the essential conditions to be met in order to use this building constraint.

Quote from: Liviu Lalescu on March 14, 2026, 11:07:33 AMAre these OK if we add to the official FET? We cannot make them more general.
For the moment, we must be satisfied with these positive results, and leave the question of generalization to the future, depending on user needs.

Quote from: Liviu Lalescu on March 14, 2026, 11:07:33 AMWe might add them now (the two custom constraints, rooms max repetitions and buildings min one activity) to the official FET. I am so excited about the latest results!
Yes, I absolutely support it.  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 11:51:28 AM
Hmm ... maybe a generalization is possible in order to avoid future errors(crashes Bug).
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 11:55:10 AM
No, it is not possible. Actually, I had in mind to add additional checks, and generation cannot start without these conditions.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 12:11:46 PM
Very good! These checks before generation prevent many errors...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 03:44:53 PM
I worked on it. I integrated in the engine, now I have interface remaining.

https://lalescu.ro/liviu/Backup-fet/ (not working).

Benahmed, a surprise: if you remove activities min/max simult., your file solves much faster!

Benahmed, please tell me: what means MTR=x and how can I check it? For each room, I must assure that it has at most x+1 teacher, for each slot?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 03:56:23 PM
Quote from: Liviu Lalescu on March 14, 2026, 03:44:53 PMBenahmed, please tell me: what means MTR=x and how can I check it? For each room, I must assure that it has at most x+1 teacher, for each slot?


mtr=x means that in the timetable of a room the number of repetitions of each teacher must not exceed the variable x, and vice versa in the timetable of the teachers; that is to say the number of repetitions of each room must not exceed the variable x.

In other words, in each room timetable we must find a number of times for each teacher that does not exceed x+1, and vice versa for the teachers' timetables.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 04:10:06 PM
I've changed my last answer. Please refresh the page.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 04:15:37 PM
OK, I saw the refreshed post.

I will only check for each room's timetable, because the reciprocal will be respected, is that right?
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 04:17:23 PM
Please prepare me, if you want, examples for NSRT! As I said, please remove or comment the max/min simultaneous, they are slowing much.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 05:11:03 PM
I'm preparing them, please wait...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 05:23:15 PM
OK!

The new code is ready!  :)  I need now to add some instructions for the users. Maybe tonight we'll have a snapshot.

We did a nice thing!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 06:07:15 PM
I attach below 3 examples of fet-nsrt
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 06:42:01 PM
Quote from: Liviu Lalescu on March 14, 2026, 04:15:37 PMOK, I saw the refreshed post.

I will only check for each room's timetable, because the reciprocal will be respected, is that right?

Yes, that's right.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 07:07:41 PM
Code ready!  :)  I need 20 minutes of break, translate to Romanian, and put the snapshot for you and our users to check/test. I'll let you know.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 07:15:25 PM
Great, we did some exceptional things!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 07:26:30 PM
Indeed!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 08:39:43 PM
The snapshot is ready!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 09:24:27 PM
Thank you, dear Liviu!
I'm translating now ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 14, 2026, 09:31:24 PM
Thanks!

Good night! 😊
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 14, 2026, 09:54:18 PM
I did it and sent you an email ...
Good night! 😊
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 06:31:19 AM
Email received. Thank you!  :)

Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 07:00:51 AM
You're welcome thank you as well! 🙂
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 08:02:31 AM
I added a new snapshot, with help for the exams. Benahmed, I hope you can translate.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 11:53:08 AM
Sure When I get home.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 12:07:53 PM
Absolutely no hurry! Sorry.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 02:44:28 PM
No problem at all. Thank you!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 02:46:29 PM
I just finished the translation and sent you an email...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 02:46:43 PM
Received!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 02:47:27 PM
Please check  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 02:56:36 PM
I sent that file back to you, so you can update the field you suggested changed. I am now waiting for your update file.

Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 07:41:30 PM
hmm ... I just had an idea; what about the other variants: MHPD, MHPW, and MSPD? Can they still be used in room comments in the official FET?
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 07:46:58 PM
Hmm... sorry, even if we created nice constraints, not comments, I am not sure we can implement them perfectly in the generation.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 07:47:34 PM
In my opinion, it's not necessary to integrate them into the official FET.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 07:48:26 PM
Great then, but we really cannot add these 3 constraints not even in the comments.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 07:51:56 PM
At the beginning of NSRT they may have been useful, but now with the new approach and constraints they have become useless even in the comments.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 15, 2026, 07:57:14 PM
Oh, really great!  :)

We found a typo in the strings, I just sent you a new email. I apologize!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 15, 2026, 09:07:56 PM
By the way, I think the nsrt version can be left on the custom versions page for those who want to use these variables, But unfortunately, it will no longer be supported after this integration into the official FET.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 16, 2026, 12:28:25 AM
The attached file below shows a specific case of exams that requires 3 teachers per building(real room).
@Liviu Lalescu: I recommend adding this example to the FET examples directory.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 16, 2026, 05:38:04 AM
I added the example.

I had in mind to remove the NSRT, but, if you want, we can leave it.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 16, 2026, 07:01:15 AM
Thank you!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 16, 2026, 07:39:26 AM
Benahmed, I have an idea to allow durations greater than one. Should we try?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 16, 2026, 07:59:56 AM
Quote from: Liviu Lalescu on March 16, 2026, 07:39:26 AMBenahmed, I have an idea to allow durations greater than one. Should we try?
Oh!... Yes, it will be a nice addition! But only If it does not lead to instability errors.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 16, 2026, 08:03:47 AM
We need to test.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 16, 2026, 08:04:26 AM
Quote from: Liviu Lalescu on March 16, 2026, 08:03:47 AMWe need to test.

Ok!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 16, 2026, 08:07:50 AM
I'll begin work in 1 hour.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 16, 2026, 03:02:55 PM
I worked hard, but I hope we arrived to a good solution. There is a new snapshot, please test intensively (durations 1 or more or both)!

https://lalescu.ro/liviu/fet/download/test/

In the process, I discovered a bug in NSRT and previous snapshot: the same seeds were not replicating the same result. I fixed that.

Please let me know!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 16, 2026, 03:19:13 PM
Thank you so much for all this hard work... We are grateful, I'll test it and let you know...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 16, 2026, 03:30:17 PM
You are welcome! Also I am grateful to you and the other users. It is pleasant to see things working...

You had a very good idea with these two NSRT constraints!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 16, 2026, 04:21:46 PM
I tested it with times 1 and 2, and it works normally.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 16, 2026, 04:25:11 PM
Great, thank you!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 16, 2026, 04:26:34 PM
You're welcome, thank you too!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 17, 2026, 01:55:50 PM
Dear Benahmed,

I redesigned the room(s) max teachers repetitions code, if you have time and patience please test some more, for values 0 or greater than 0, for activities with duration 1 or more.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 17, 2026, 02:14:06 PM
I just got home. I'll test and let you know. Thank you!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 17, 2026, 02:48:31 PM
Hmm... I found a bug in the new code. Please wait with the testing...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 17, 2026, 02:56:14 PM
Ok!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 17, 2026, 03:10:29 PM
I just added the corrected version. Thank you for your patience!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 17, 2026, 03:43:36 PM
Dear Benahmed, I have an important question for you: should we make "max teachers repetitions" represent "max teachers appearances"? Meaning the minimum accepted value will be 1, instead of 0, for a single appearance. I really think it would be a good change.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 17, 2026, 04:57:01 PM
The "appearance" can be confusing; the term "repetition" is more appropriate in this regard. This constraint has been in place for over five years; users are used to it, and changing it now would be risky... I Think ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 17, 2026, 04:59:46 PM
Indeed, Benahmed, you are so right!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 17, 2026, 05:24:07 PM
A significant improvement in generation speed and behavior; time flows normally, no jump. Thank you for this very good work!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 17, 2026, 05:26:22 PM
You are welcome, dear Benahmed! I hope on 19 March early morning we'll release the new official version. We had a great collaboration!!!

I am so tired... but pleased!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 04:18:04 AM
After the successful implementation of MTR in the official FET and the latest improvements regarding speed and behavior, I had an idea while consulting the teachers' schedules (see attached screenshot below), which consists of making a small improvement to MTR. since each real room is divided into 2 rooms named with the same name, and which in reality designate the same room. this division - let us remember - is to allow an activity to have 2 teachers.

If you look closely at the screenshot attached below, you can easily see that this constraint did not prevent the repetition. For this reason, I suggest adding a condition to this constraint that excludes rooms in the same building, and only assigns one room in the same building to the teacher.

Remembre, I accomplished this using tricks, but these tricks were rather manual (as you yourself described in this open topic); FET wasn't free in his choices...
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 18, 2026, 04:58:45 AM
This is exactly what I was trying to convey: adding a solution to this issue by  a constraint on the maximum number of occurrences of the building as a whole for a teacher. When this constraint is applied at the building level, FET will assign only one room from that building to the teacher, effectively avoiding repetitions across rooms that actually represent the same physical space.

Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 05:24:07 AM
Quote from: YOUSSEF HOUIET on March 18, 2026, 04:58:45 AMThis is exactly what I was trying to convey: adding a solution to this issue by  a constraint on the maximum number of occurrences of the building as a whole for a teacher. When this constraint is applied at the building level, FET will assign only one room from that building to the teacher, effectively avoiding repetitions across rooms that actually represent the same physical space.



Applying this constraint to a building does not prevent the repetition of elements within that building. It is safer to add a condition to the MTR to guarantee non-repetition.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 05:38:36 AM
Dear Benahmed:

1) Please give me the fet file for you screenshot.

2) Add an implicit condition to the room(s) max teachers repetitions? Meaning that all such constraints must respect as you said?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 05:48:32 AM
Quote from: Liviu Lalescu on March 18, 2026, 05:38:36 AM1) Please give me the fet file for you screenshot.
Attached...

Quote from: Liviu Lalescu on March 18, 2026, 05:38:36 AM2) Add an implicit condition to the room(s) max teachers repetitions? Meaning that all such constraints must respect as you said?
Not really an implicit condition, but rather a condition that can be chosen or not by the user through a selection box.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 06:01:28 AM
How could we name that option?

I'll try to think, but I am not sure an efficient implementation is possible.
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 18, 2026, 06:04:09 AM
Instead of adding an exception constraint to exclude building rooms from the current MTR constraint, why not introduce a new constraint at the building level? This constraint would allow assigning only one room from a given building to a teacher. In this way, we ensure that the building is allocated only once and that only one of its rooms is assigned, thereby satisfying the required condition.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 06:11:34 AM
Quote from: Liviu Lalescu on March 18, 2026, 06:01:28 AMHow could we name that option?

For example: Exception rooms in the same building
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 06:21:05 AM
If this condition is not selected, MTR affects only one room among the rooms in the building.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 06:24:50 AM
Quote from: Benahmed Abdelkrim on March 18, 2026, 06:11:34 AM
Quote from: Liviu Lalescu on March 18, 2026, 06:01:28 AMHow could we name that option?

For example: Exception rooms in the same building

Maybe another name: allow rooms in the same building
If this condition is not selected, MTR affects only one room among the rooms in the building.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 06:25:56 AM
I am comparing in my mind both Benahmed's and Youssef's suggestions and I hope one will be successful.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 06:29:25 AM
How about: "Force same room in a building"?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 06:31:45 AM
Quote from: Liviu Lalescu on March 18, 2026, 06:29:25 AMHow about: "Force same room in a building"?

yes it is a good name
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 06:35:02 AM
Dear Youssef,

I have analyzed also your proposal, thank you very much (max 1 room for a teacher for same building?)! But I kind of tend to prefer Benahmed's proposal with "Force same room in a building".

I'll think some more.
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 18, 2026, 06:38:38 AM
Thank you very much.
No problem—as long as the objective is the same, any approach that achieves it works, whatever the method used.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 06:39:59 AM
Thank you for your understanding, Youssef!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 07:14:07 AM
@YOUSSEF HOUIET: Thank you for your participation in this discussion. We hope that our Moroccan brothers benefit from these new constraints and find their needs met.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 10:04:43 AM
It ready, dear Benahmed and Youssef. Please test and let me know!

Benahmed, please translate for me (I ask again for your kindness!). There are 5 new fields.

https://lalescu.ro/liviu/fet/download/test/

I hope to release in maximum 2 days.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 10:11:40 AM
Great, Thank you so much your kind help; I will download, complete the translation, and test the new option...🙂
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 11:08:46 AM
It's done and sent by email. I tested it, everything's fine.
I attach again the last file attached above; I corrected a typo... with All constraints are now opened.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 12:15:23 PM
Thank you for the good news! I will add this as an example, too.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 18, 2026, 12:30:22 PM
You're welcome and thank you too dear Liviu for your kind help. Now MTR is perfect with the building constraint. 🙂
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 18, 2026, 12:31:56 PM
You're welcome, dear Benahmed!  :)
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 19, 2026, 04:12:08 PM
After testing, the option works without any problems and the results are very nice.
Thank you for these great improvements.

Title: Re: min activities in a building
Post by: Liviu Lalescu on March 19, 2026, 04:14:13 PM
You are welcome! Thank you, as well!  :)

I hope the new official version will be released tomorrow early morning.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 20, 2026, 04:09:53 AM
Hello dear Liviu!
Another example if you can add it; otherwise, we can postpone it until the next release.

With these seeds, generation is almost instantaneous (Time=2s!)
s10=4134473542, s11=3852153646, s12=1445048053,
s20=556066500, s21=188855359, s22=994811296.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 20, 2026, 05:03:18 AM
OK, dear Benahmed, I added it.  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 20, 2026, 05:06:15 AM
Oh thank you 🙂
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 20, 2026, 05:13:15 AM
You're welcome!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 06:45:36 AM
Dear Benahmed,

I really hope you will understand this problem: I received an email telling me that the new constraint is cumbersome to understand and use with "max repetitions". It would be much better to have something like: "room(s) max activities per teacher" or "room(s) max activities with each teacher", where simply the max is max repetitions+1.

We can use the old files (FET-7.8.1) and add 1 and report the change to the user.

It is more FET-notation.

Also, I invited that person who wrote me that email to participate in the forum discussion.

I will go on a walk now and reply maybe 2 hours later.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 07:26:22 AM
I'll think about it and answer ...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:06:04 AM
I agree to change the name of this constraint, respecting FET's notation. The name, "Max activities in the room for each teacher," expresses this repetition more explicitly, making it easier to understand.

If we set max activities = 0 in a certain room, this means that the teacher will have no activities in that room. In this specific case, the constraint forbids the teacher from having activities in a certain room(s), which contradicts the MTR, unless of course we have to introduce modifications in the code. Remember, mtr=0 allows the teacher(s) to have only one activity in the room(s)...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:16:40 AM
Changing the name could generalize the application of this constraint and no longer limit it to exams only, This is interesting ... I think
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 08:16:45 AM
Thank you for your kind understanding, dear Benahmed! 0 becomes 1, and 1 is minimum allowed.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:19:22 AM
Quote from: Liviu Lalescu on March 21, 2026, 08:16:45 AMThank you for your kind understanding, dear Benahmed! 0 becomes 1, and 1 is minimum allowed.

We can leave the 0 instead of the 1, that's very interesting, it means the teacher will have no activity in the room, it's very general
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 08:25:05 AM
All teachers, so equivalent with room not available.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:28:46 AM
Quote from: Liviu Lalescu on March 21, 2026, 08:25:05 AMAll teachers, so equivalent with room not available.
In this particular case, we can warn the user that 0 for all rooms(teachers) means no rooms at all...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 08:34:35 AM
I think we should deny 0.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:40:17 AM
Quote from: Liviu Lalescu on March 21, 2026, 08:34:35 AMI think we should deny 0.

Yes, I understand your concern, but this constraint could be used to forbid the teacher(s) from using certain room(s) if we put max activities =0 ... I think...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 08:48:27 AM
Hmm... it is much more efficient the constraint room not available. It is for all teachers, so probably perfectly equivalent to room not available constraint?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:53:33 AM
Ok! I agree with your approach; max 1 is more reasonable.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 08:56:03 AM
I thank you for your understanding, and I will now begin the change. The name of the constraint will be changed, but the behavior will remain the same, only with +1. The old files will be opened and updated correctly - no need from the user to do anything.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:58:18 AM
Thank you dear Liviu. Let me know when it's ready
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 09:01:29 AM
I estimate in a few hours. I'll write here.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 01:56:01 PM
Dear Benahmed, it is ready (I had to do also some other suggestion).

https://lalescu.ro/liviu/fet/download/test/

Please check and let me know if you like it!

To translate, prefer: https://lalescu.ro/liviu/Backup-fet/ (I might change some fields sooner than on 'test').

Edit: could you please compare on some files, the seeds for official-7.8.1 should be the same at the end as 7.8.2-snapshot (if you also start with the same seed; respectively, for each file)?
Title: Re: min activities in a building
Post by: flauta on March 21, 2026, 03:24:44 PM
Quote from: Benahmed Abdelkrim on March 21, 2026, 08:16:40 AMChanging the name could generalize the application of this constraint and no longer limit it to exams only, This is interesting ... I think
I agree. I think in this form the constraint can be useful in other situations. I will test it in my school's timetable, where we have 2/3/4 subject rooms in which distribute the teacher's hours.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 03:26:20 PM
I just see it. I will download, translate, test, and let you know ...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 03:32:31 PM
By the way, our constraint can be used in more general cases; a simple name change changed everything... I wonder why we didn't notice this sooner?!
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 21, 2026, 03:51:21 PM
This is because we focused on applying this constraint only to exam-related cases.
However, it could also be useful in more general scenarios. In the future, the constraint could be generalized to apply to a  set of activities, defined through criteria such as a specific teacher, activity tag, subject,...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 04:15:07 PM
Quote from: Liviu Lalescu on March 21, 2026, 01:56:01 PMEdit: could you please compare on some files, the seeds for official-7.8.1 should be the same at the end as 7.8.2-snapshot (if you also start with the same seed; respectively, for each file)?
I tested it with 3 files; the seeds after are the same...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 04:16:31 PM
Quote from: Liviu Lalescu on March 21, 2026, 01:56:01 PMPlease check and let me know if you like it!
The new name seems nicer and clearer now...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 04:17:31 PM
Great! Thank you, flauta, Benahmed, and YOUSSEF!

I added YOUSSEF's suggestion in the TODO list. We'll see.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 04:39:46 PM
Dear Benahmed and maybe YOUSSEF,

Should we consider to make the new constraint "room(s) max activities per teacher" consider that an activity with two or more teachers will count, as well? Now, only activities with a single teacher are considered, because all activities in Benahmed's examples had a single teacher and because it was (much?) easier.
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 21, 2026, 05:00:46 PM
In its current use, the constraint is applied only to activities with a single teacher. I do not think it is necessary to extend it to activities involving two or more teachers.

Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 05:26:35 PM
Quote from: Liviu Lalescu on March 21, 2026, 04:39:46 PMShould we consider to make the new constraint "room(s) max activities per teacher" consider that an activity with two or more teachers will count, as well? Now, only activities with a single teacher are considered, because all activities in Benahmed's examples had a single teacher and because it was (much?) easier.
 
No, let's leave things as they are. This constraint applies to each room (let's remember, 2 or 3 activities) concerns the buildings, not the rooms...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 05:28:55 PM
I just finished the translation. I sent you an email. please check
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 05:35:55 PM
Quote from: flauta on March 21, 2026, 03:24:44 PM
Quote from: Benahmed Abdelkrim on March 21, 2026, 08:16:40 AMChanging the name could generalize the application of this constraint and no longer limit it to exams only, This is interesting ... I think
I agree. I think in this form the constraint can be useful in other situations. I will test it in my school's timetable, where we have 2/3/4 subject rooms in which distribute the teacher's hours.
I think we should provide a sample file to see how this constraint works in a real-world situation.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 05:38:34 PM
Benahmed, file was received. Thank you! I am so glad we did a good job!

OK, Benahmed and YOUSSEF, you know better than me about the activities with multiple teachers. We'll do as you suggest.

Yes, we may add a file like that.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 07:46:13 PM
@Volker Dirr , could you please see my reply #221 and tell me what you think?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 07:58:08 PM
Quote from: Liviu Lalescu on March 21, 2026, 04:39:46 PMDear Benahmed and maybe YOUSSEF,

Should we consider to make the new constraint "room(s) max activities per teacher" consider that an activity with two or more teachers will count, as well? Now, only activities with a single teacher are considered, because all activities in Benahmed's examples had a single teacher and because it was (much?) easier.

I reread your answer, and I admit I only skimmed it. I now understand, and I agree with you about counting the activities of 2 or more teachers.
Title: Re: min activities in a building
Post by: Volker Dirr on March 21, 2026, 08:00:19 PM
I guess in most situations counting also activities with 2 or more teachers is preferred by the user.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 08:01:17 PM
Indeed, Benahmed and Volker! I will try tomorrow early morning, maybe. It's going to be a tough one  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:02:51 PM
Quote from: Liviu Lalescu on March 21, 2026, 08:01:17 PMIndeed, Benahmed and Volker! I will try tomorrow early morning, maybe. It's going to be a tough one  :)

I wish you success! 🙂
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 21, 2026, 08:09:23 PM
Thank you! Maybe you could prepare me a difficult and interesting test case? Or more?

Good night!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 21, 2026, 08:43:33 PM
@Liviu Lalescu: We should consider cases where we find 3 teachers in a building, and cases where the user no longer wants more than 2 teachers per building. Maybe a new building constraint could be considered, or maybe a workaround that could simplify the solution?!

Things are getting more complicated...

Maybe these constraints could be added: max activity tags from a set per day (real) for a building(s)

Good night!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 04:28:58 AM
Dear Benahmed,

I added your words in the TODO.

Could you please devise an interesting file to check counting activities with 2 or more teachers?
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 22, 2026, 04:31:34 AM
Hi @Benahmed Abdelkrim
Attached is a sample based on a real case for generating supervision timetables for Moroccan Baccalaureate exams (national and regional). This file is specifically intended for Moroccan users and is meant to be added to the examples folder for reference and inspiration.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 04:38:06 AM
Quote from: Liviu Lalescu on March 22, 2026, 04:28:58 AMCould you please devise an interesting file to check counting activities with 2 or more teachers?
 
I will now try to devise a file of this type and put it here.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 04:45:23 AM
Hi @YOUSSEF HOUIET !
An interesting file that shows a real-life situation in a baccalaureate exam.
@Liviu Lalescu , I think we should add this file as an example in FET/examples.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 04:54:19 AM
Sure, I added it before.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 05:02:05 AM
Thank you!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 06:00:13 AM
The test file is attached below. In some cases, buildings are found with 3 or 4 teachers! (see tne screenshot attached below), which is unacceptable since we don't want more than 2 teachers per building in this example. A solution should be considered to resolve this situation. In this regard, I suggest adding a building constraint like the one mentioned above (Maybe these constraints could be added: max activity tags from a set per day (real) for a building(s)).

I think this constraint already exists for rooms, which makes it easy to add to buildings.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 06:08:45 AM
Dear Benahmed,

The new constraint will be just in the TODO for now, since it is too complicated and we need to think.

But, could you give me an example or more with more teachers per activity and we'll check room(s) max activities per teacher?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 06:21:05 AM
Here are two examples where activities involving more than two teachers are not counted with the option: room(s) max activities per teacher.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 06:34:25 AM
The example file is attached to my reply #240, It includes activities with 2 teachers per activity.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 06:37:55 AM
OK, thank you! I'll see a bit later. I am working hard, and I have a bug...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 07:06:18 AM
I solved that bug and it seems to work. I'll put a snapshot, there are a few new fields to translate.

But, Benahmed, about your problem: too many teachers per building, I am not sure I understand your suggestion with tags.

Is this a big problem?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 07:42:25 AM
To be clearer: activities from 1 teacher are tagged with, let's say, tag1, and activities from 2 teachers are tagged with tag2. A constraint max activity tags from a set per day for a building(s), This will prevent the activities of tag1 and tag2 from taking place on the same day, thus avoiding the presence of 3 teachers in the same building, as illustrated by the screenshots attached above.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 07:53:42 AM
It's easy to avoid having 4 teachers per building; simply apply this constraint to the rooms and choose activities tag2, max=1.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 08:01:29 AM
Unfortunately, applying this constraint to rooms doesn't prevent tag2 activities from meeting; we need another solution...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 08:09:37 AM
But, dear Benahmed, why complicate so much? You added buildings = 2 rooms, just to avoid more than 2 activities per real room. So, add 2 activities with a single teacher each, and a constraint activities same starting time for these 2 activities.

I just put a new snapshot with 3 new fields, could you also translate them when you have the possibility?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 08:10:02 AM
I corrected a minor typo. I reattach the file below...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 08:14:38 AM
OK, thank you! I replaced the file (but it is not in the examples for exam, but in tests). If you want, I could place it in the examples for exam.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 08:18:39 AM
Quote from: Liviu Lalescu on March 22, 2026, 08:09:37 AMBut, dear Benahmed, why complicate so much? You added buildings = 2 rooms, just to avoid more than 2 activities per real room. So, add 2 activities with a single teacher each, and a constraint activities same starting time for these 2 activities.
I don't think that will solve this problem, which consists of avoiding having 3(or more) teachers meeting in the same building (real room).
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 08:20:02 AM
Quote from: Liviu Lalescu on March 22, 2026, 08:14:38 AMOK, thank you! I replaced the file (but it is not in the examples for exam, but in tests). If you want, I could place it in the examples for exam.
Please place it in the fet/examples folder.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 08:21:32 AM
For each real activity with 2 teachers, add 2 FET activities, each with 1 teacher, and same starting time for them 2. A FET room hosts a single activity, so in a FET building with 2 FET rooms -> only max 2 FET activities, each with 1 teacher.

I don't understand the problem.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 08:21:59 AM
Quote from: Benahmed Abdelkrim on March 22, 2026, 08:20:02 AM
Quote from: Liviu Lalescu on March 22, 2026, 08:14:38 AMOK, thank you! I replaced the file (but it is not in the examples for exam, but in tests). If you want, I could place it in the examples for exam.
Please place it in the fet/examples folder.

OK!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 01:36:00 PM
...maybe one option, such as a dialog box in the new constraint; room(s) max activities per teacher could solve this problem.
This option ensures that the activities of several teachers do not share the same building with other activities.
If this option is possible, we can think about a suitable name.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 01:40:57 PM
I will add your words in the TODO and think of them.
Title: Re: min activities in a building
Post by: YOUSSEF HOUIET on March 22, 2026, 01:47:08 PM
@Benahmed Abdelkrim

I have another idea that we might need:
Introduce a constraint for the minimum number of activities in a building from a given set of activities.
This would help ensure placing, for example, at least one activity from a specific teacher category in a building (e.g., at least one male teacher, or a teacher of a certain professional grade).
But now, however, we let Liviu focus on improving the current features.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 01:49:22 PM
I will add your suggestion in the TODO list, Youssef, thank you!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 07:33:55 PM
Quote from: Liviu Lalescu on March 22, 2026, 01:40:57 PMI will add your words in the TODO and think of them.

I've been thinking about this; I tried to solve this problem manually, but there's no solution. We can't avoid having 3 teachers per building. I was only able to avoid 4 teachers per building by using tags. You can remove my suggestion from the TODO file.
 
thank you dear Liviu!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 22, 2026, 07:38:52 PM
Dear Benahmed,

We should keep your suggestion in the TODO. The TODO is a file where I gathered all the suggestions from the users over the years and sometimes (rarely) I check it and think if an item is possible.

I removed your tags suggestion, but not the reported problem. Here is the current (latest, updated now) TODO item:

---
843---------------------------------------------------------
From Benahmed Abdelkrim (on forum):

https://lalescu.ro/liviu/fet/forum/index.php?topic=6772.msg37930#msg37930

We should consider cases where we find 3 teachers in a building, and cases where the user no longer wants more than 2 teachers per building.
Maybe a new building constraint could be considered, or maybe a workaround that could simplify the solution?!
---
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 22, 2026, 07:51:39 PM
Ok!.. as you want!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 23, 2026, 05:20:40 AM
I think I've found a solution to this problem. We should calculate the activities correctly to avoid having 3 or 4 teachers per building. And the interaction of the last two exam constraints will do the trick. Here's the file after a few necessary modifications...

In this context, the previous file with its data state has no solution, unless necessary modifications are introduced as shown in the attached file below...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 23, 2026, 06:02:29 AM
OK, Benahmed, I removed your previous file (Benahmed-6) and added this one instead.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 23, 2026, 06:53:18 AM
I think we should leave it so the user can compare the two and understand the solution, with the addition of a small note: the solution can accommodate 3 or 4 teachers per building.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 23, 2026, 06:54:39 AM
OK, I'll do this.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 23, 2026, 06:57:14 AM
Thank you! 🙂
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 23, 2026, 06:58:28 AM
You're welcome!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 23, 2026, 06:59:41 AM
Now I'm going to hit the road and be away for 1 or 2 days...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 23, 2026, 07:05:13 AM
OK, have a great time!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 23, 2026, 07:20:04 AM
Thank you!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 24, 2026, 10:02:59 PM
I think we should take a closer look at this file. This file contains rooms not available, a constraint building max min 1 activity ... FET remains stuck at activity 347. But if we disable this last constraint (building max min 1 activity), FET successfully generates the timetable?! Is this normal? Isn't there a bug?!
The file is attached below ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 05:03:28 AM
You mean min, not max?

Unfortunately, it is not a bug. It is normal, because in B1/b1 you disabled those slots, but FET needs also min one activity in building B1. Only break slots are not considered.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 05:28:35 AM
Yes, I meant min, not max.

Shouldn't we warn the user about this specific case? Not all users will understand this!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 05:29:50 AM
I'll try to issue a warning.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 05:30:47 AM
Thank you dear Liviu!
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 05:44:13 AM
By the way, I forgot to mention that FET takes all buildings into account when using the constraint for each individual building? I tried to avoid this stuck by using a min 1 activity for each building, but unfortunately, FET warns me that this constraint must be used for all buildings!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 05:49:09 AM
Yes, there is no other practical solution than to add this constraint for all buildings...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 05:52:38 AM
Don't we need something? An improvement or I don't know?
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 06:37:41 AM
Unfortunately, it seems very difficult. But I'll try to think.

What would you want? When a building is not available (all of its rooms have 100% not available in a slot), the min 1 hour should not be considered for this slot?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 06:46:02 AM
Yes, this problem arises when a building is not available, meaning that all of its rooms are not available, in this case this constraint should not be considered.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 07:00:32 AM
If I could make the constraint for only the set of selected buildings, would it be a good solution?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 07:08:57 AM
Yes, that's one solution, but we should also consider the case where the user applies this constraint to all buildings...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 10:37:51 AM
Dear Benahmed,

I hope I managed it: only available slots, and for any building. Could you please test intensively with these new changes?

https://lalescu.ro/liviu/fet/download/test/
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 11:36:50 AM
Thank you dear Liviu!
Sure I will test and report...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 11:45:53 AM
Regarding the name change, to be true, it is the translation I gave to the name of the previous constraint, because a literal translation seems long and strange to me... ;)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 11:51:44 AM
:)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 11:54:46 AM
The problem is solved! It works perfectly! I'll translate it now and send the ts file soon ...  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 11:57:26 AM
Great! But please test on more variants, like not having the constraint "building(s) min one activity in available slots" for some buildings (but having it for some).
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 11:59:02 AM
Ok! ...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 12:55:30 PM
I just finished the translation. The file has been sent...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 12:57:56 PM
Yes, thank you! File received.

If you derive test files, please send them to me.

I am trying on a file and I think I must derive some improvements.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 01:41:36 PM
Quote from: Liviu Lalescu on March 25, 2026, 11:57:26 AMGreat! But please test on more variants, like not having the constraint "building(s) min one activity in available slots" for some buildings (but having it for some).

Yes, I tested the constraint with some buildings, but not with others... the results without errors
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 02:06:36 PM
... using the same attached file as above, with a few modifications
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 02:49:43 PM
I added a new snapshot, with improvements. Maybe you can test on a couple of files.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 03:05:23 PM
Ok I will...
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 03:53:08 PM
Everything seems okay. I've noticed that these improvements have slightly increased the generation speed... Thank you for these important updates...  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 03:55:05 PM
The seeds after generation are the same ...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 25, 2026, 03:56:15 PM
Thank you!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 25, 2026, 06:55:39 PM
You are welcome!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 28, 2026, 11:07:24 AM
Dear Benahmed,

I added a new snapshot, could you test that the generation begins on your correct files? No need to wait for finishing.

Explanation: I check better before start if the file is impossible and not all buildings have the constraint and not all activities can go in the constrained buildings.

Link: https://lalescu.ro/liviu/fet/download/test/
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 28, 2026, 01:17:01 PM
I tested it with some files; the generation starts normally, I didn't notice any difference!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 28, 2026, 01:25:19 PM
Exactly! Thank you!
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 28, 2026, 01:35:44 PM
A difference is made by the attached example (new snapshot won't let you begin the generation; previous snapshot will let you begin the generation, but will not finish).
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 28, 2026, 01:45:28 PM
... Indeed dear Liviu!  I tested with the number of activities is less than the number of hours open in the buildings, the generation is stopped and the user is notified to modify their data.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 29, 2026, 10:53:14 AM
Thank you, dear Liviu, for this important update which has brought considerable improvements; Among them, the issue of impossible files: the user is warned to modify their data before launching the generation due to the new constraint related to the building(s).
 
I was convinced that NSRT is very useful, as I and other users have been using it for almost 6 years to create exam schedules, and it would be very beneficial to add these functions to the official FET.

The idea of integrating NSRT into the official FET proved very useful. I hope other users will contribute their suggestions to further improve FET and make creating exam timetables easier.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 29, 2026, 10:56:19 AM
You are welcome, dear Benahmed, and thank you for a fruitful collaboration!  :)
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 29, 2026, 11:04:46 AM
you are welcome, dear Liviu, and thank you too!  :)
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 30, 2026, 12:56:43 PM
Hello again, Benahmed,

I have a question for you and maybe for other users: should I consider removing the word "Exam" from the short and from the detailed description of the two new constraints, and make them like the other ones?
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 30, 2026, 07:02:23 PM
Hello dear Liviu,
Yes, that's a good idea, but we need to think about it carefully and not rush into it. Currently, these constraints are recent and primarily intended for creating exam schedules. I'm afraid that if we remove the word "exam," users won't understand their purpose unless we modify the "help" to explain that they are used to create exam schedules.

Also, if we remove this term, it means that these constraints can be used in general cases, but we must provide examples for this, so that the user understands their usefulness in real cases.

Hmm... maybe we need other opinions from other users to make the right choice...
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 30, 2026, 07:55:39 PM
Sure, dear Benahmed, we'll wait.

Edited to add: I only referred to the description that appears in the list box on the left (in the beginning there is: "Exam:"), listing the constraints (in the specialized dialog or all space constraints) and to the detailed description that appears on the right when you click that constraint ("Exam space constraint" instead of simply "Space constraint", like the other space constraints).
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on March 30, 2026, 08:31:43 PM
Hmm... in that case, we can remove that term. The help and description will remain unchanged; only that term will disappear. Personally, I'm not opposed to it; on the contrary, it's an excellent idea, because I think these constraints can be used in general situations.
Title: Re: min activities in a building
Post by: Liviu Lalescu on March 30, 2026, 08:42:25 PM
Great then, with the next version.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on April 03, 2026, 10:08:19 AM
Room(s) max activities for a Teacher?

Is it possible to add the constraint "room(s) max activities for a teacher" which would apply individually to each teacher, in case some teachers need more than one activity in a room, while other teachers have max activities=01?
Title: Re: min activities in a building
Post by: Liviu Lalescu on April 03, 2026, 10:17:38 AM
Do you mean =1?

I'll add this in the TODO.
Title: Re: min activities in a building
Post by: Benahmed Abdelkrim on April 03, 2026, 10:24:03 AM
Yes, I corrected. Thank you!