add a constraint that limits the maximum number of days a series of activities c

Started by moke, October 03, 2025, 12:24:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

moke

I have a requirement: for example, there are five days, each lasting two hours. Teachers' classes can be combined, but a particular teacher's class cannot exceed three days. How can this be implemented? FETs generally don't allow repeated classes. If I change the teacher names to Zhang San 1 and Zhang San 2, how can I ensure that the maximum number of days for a teacher with Zhang San in their name cannot exceed three? Alternatively, can You add a constraint that limits the maximum number of days a series of activities can be within a week?

Liviu Lalescu

Hello!

There is a new constraint, just introduced in FET-7.5.1, activities occupy max sets of time slots from selection; unfortunately, you can only specify max as 1 or 2, not 3, which would be complicated to make.

You could associate a dummy teacher DT to each such group of activities and constrain teacher DT to max 3 days per week.

moke


Liviu Lalescu


moke

After adding DT to these activities, will these activities not conflict in time, since DT is the same and the same teacher should not be able to teach more than one class at the same time?

Liviu Lalescu

Yes, you are right! I apologize. I will add your suggestion in the TODO list, but unfortunately it is difficult.


Liviu Lalescu

Hello again, moke,

I have some possible workarounds:

1) Add A1, A2 (Zhang San 1, durations 2+2), A3, A4 (Zhang San 2, durations 2+2), and make their start time the same. They will ensure that the other activities are in max 3 days.

or

2) You have 5 days, each with 2 hours. So, there are 25=32 variants to choose 5 hours and ensure that they are max 3 occupied. You could add 32 constraints activities occupy max 3 time slots from a selection of 5 slots. Yes, tedious and difficult, sorry!

Liviu Lalescu

Hello, @moke ,

I just did it in a snapshot, for now. Please see the Snapshots section of the forum: https://lalescu.ro/liviu/fet/forum/index.php?topic=6632.0 , or get it from https://lalescu.ro/liviu/fet/download/test/ (for now, until the official version is out).

You can select any number, not only 1 or 2.

Please test and let me know!


Liviu Lalescu