A suggested new type of constraint

Started by Liviu Lalescu, August 12, 2025, 07:21:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu

Hello, forum,

I received from Youssef Bourdha (via GUEFFAZ REDA, on Facebook) a suggestion to constrain the students to begin either at the first hour or at the third. This is what I understood they need, but they suggested probably wrong:

To implement students begin early max beginnings at third hour. They wanted to use both 0 beginnings at second hour so that the students wouldn't start the day at the second hour, but only at the first and third. This is what I understood.

But it won't work. 0 beginnings at second hour means the students must begin at the first hour.

However, I thought of a conditional constraint: if the students set has activities at second hour, it must have activities also at the first hour. It might work, but I don't know exactly how to name it and organize it.

Benahmed Abdelkrim

But why this constraint is needed? If there is a need to begin at 3 hour, it is enough to simply not use the constraint of begin earlier max at 2 hours, specially in the complex timetables(number of rooms < number of groups of students).
 I
B.A/krim

Liviu Lalescu

Dear Benahmed,

They would like a students set to begin their days either at the first hour or at the third hour (but not at the second hour).

Maybe a new constraint named just like that, students (set) begins at first or at third hour.

Or other complex constraint, like: students (set) if has activities in slots X (x1, x2, x3, x4, x5) then it has activities in slots Y (y1, y2, y3, y4, y5), respectively.

YOUSSEF HOUIET

I think this is a special case that can be handled with a custom version, since the required constraint will be used only in this case. In principle, adding constraints should be general so they can be used by a large number of users.

Liviu Lalescu

Yes, I agree, but I think I had other requests in the past that students begin in 1st or 3rd hour, not in the 2nd.

And a general conditional constraint might be useful for more users...

Benahmed Abdelkrim

Quote from: Liviu Lalescu on August 13, 2025, 12:03:17 PMDear Benahmed,

They would like a students set to begin their days either at the first hour or at the third hour (but not at the second hour).

Maybe a new constraint named just like that, students (set) begins at first or at third hour.

Or other complex constraint, like: students (set) if has activities in slots X (x1, x2, x3, x4, x5) then it has activities in slots Y (y1, y2, y3, y4, y5), respectively.


Or maybe a smart and complex constraint like: if activities cannot be scheduled at second hour they are scheduled at third hour.

Or it can be added as an option in the existing constraint: students (set) begins earler (max beginnings at second hour) ...
B.A/krim

Liviu Lalescu


Benahmed Abdelkrim

QuoteOr it can be added as an option in the existing constraint: students (set) begins earler (max beginnings at second hour)

as a selection box: allow beginnings at third hour.
B.A/krim

Liviu Lalescu


Aboulhamid

First of all, I would like to sincerely thank the team for your outstanding efforts.
Currently, the program includes two categories of constraints depending on the scope: one that applies to an individual teacher, and another that applies to all teachers.
If possible, it would be highly appreciated to add a third category of constraints that applies specifically to a selected group of teachers.
Thank you in advance.

Liviu Lalescu

Thank you for your kind words!

Unfortunately, such a feature was not thought of from the start. It would be a very complex task to make it now.

I will add your suggestion in the TODO. It was suggested by more users in the past.

But if sponsored, I would consider it.

Aboulhamid

Thanks a lot for replying my message

Vangelis Karafillidis

Liviu.

I think that there might be some kind of misunderstanding...
There are two variants.
1) The "literal" variant: The user needs to define a group of teachers and then apply the necessary constraints to this group of teachers.
2) The "functional" variant: The user can select the teachers they need (let's say by clicking on the respective checkbox for each one of the teachers), and then add the constraint to the selected teachers (practically: add multiple constraints at once... one constraint for each one of the selected teachers).

The 1st variant seems to be what Aboulhamid suggested, and most likely it's difficult and tricky to code.
The 2nd variant, seems (at least to me) to be primarily some kind of UI "manipulation", which most likely does not need some "tricky" code for defining groups teachers, plus some "exotic" code for applying constraints to groups of teachers. Maybe... the 2nd variant (regarding the functionality part) is a good option, without severe implications regarding the coding part. What do you think Liviu? And... what do other users think about these variants?

Vangelis.


Liviu Lalescu

Vangelis, I considered the first variant (defining groups of teachers).