Insurmountable Arbitrary Penalty for Unavailable Time HARD Rule Break
complete
g
gilles@equina.io
Please set any Unavailable Time HARD rule break to an insurmountable amount. The current hard penalty is too low and results in employees getting assigned to shifts when they are on vacation when there is another hard rule (i.e. min rule) in place. The min rule typically has a higher positive hard value that overrides the unavailable hard penalty, causing the employee to be assigned. Even when unavailable time is prioritized, the hard penalty is too low. In Optaplanner, we used to be able to arbitrarily set the hard penalty score to prevent this situation from occurring. This will help to prevent negative optics with clients when they discover employees assigned on vacation / unavailable days.
Log In
Jurriaan Persyn
complete
Thank you for sharing your feedback — it helps us make Timefold even better for you.
In v0.36.1 we decided to deprecate the "min
" + required satisfiability for the reason you gave. We now encourage users to only use "min
" constraints with preferred satisfiability. See https://docs.timefold.ai/employee-shift-scheduling/latest/new-and-noteworthy#_deprecation_of_required_minimum for details.We suggest to replace something like:
{
"periodRules": [
{
"id": "min-5-shifts-per-week",
"period": "WEEK",
"satisfiability": "REQUIRED"
"shiftsWorkedMin": 5
}
]
}
with:
{
"periodRules": [
{
"id": "min-5-shifts-per-week",
"period": "WEEK",
"satisfiability": "PREFERRED"
"shiftsWorkedMin": 5
}
]
}
Additionally, you can then boost the constraint weight
shiftsWorkedPerPeriodNotInPreferredRangeForEmployeeWeight
(also via a configuration profile) to give this constraint more importance.If you have any questions or further suggestions, feel free to reach out!
Jurriaan Persyn
VP Product
g
gilles@equina.io
Jurriaan Persyn - Thanks for your response and for sharing the deprecation details around required min constraints.
That said, removing the ability to set min as a required hard rule isn’t a practical solution for us. We actively use hard min constraints with clients every day to enforce minimum staffing levels — it's a core part of how we ensure safe coverage with our client scheduling.
The issue we’re raising isn’t about the existence of required min constraints — it’s about the inability to make Unavailable Time a truly insurmountable hard constraint. In real-world use, Unavailable Time rules need to always take precedence, especially over other hard rules. If a user is on vacation, they should never be scheduled — period — and we need a way to enforce that in the scoring logic.
In OptaPlanner, we were able to arbitrarily increase the hard penalty to prevent this exact situation. We’re looking for that same level of control in Timefold — not the removal of required min constraints altogether.
Is there a recommended way to ensure that Unavailable Time hard rules are never overridden, regardless of other hard rule weights?
Appreciate your support.