Hierarchy of intermediate shifts
Intermediate shifts are assigned once the minimum staffing requirement is met and sufficient personnel resources are available. The assignment of these shifts follows a specific pattern: we prioritize one shift per day for each weekday, followed by weekend shifts. After that, we aim to assign two shifts on weekdays, and then again on weekends.
In cases where two or more intermediate shifts are scheduled in a single day, the station management will convert them into early and late shifts, as these options tend to be more popular among staff. However, it’s important to note that this conversion process is currently manual and not automated by our application.
Implemented using Google's OR Tools¶
model.add(
num_of_weekday_intermediate_shifts_variable
>= num_of_weekend_intermediate_shifts_variable
)
model.add(
num_of_weekday_intermediate_shifts_variable
- num_of_weekend_intermediate_shifts_variable
<= 1
)
The implementation of this constraint does only work in combination with another objective Free Days Near Weekend. To somehow ensure the correct hierarchy of the assigning of the intermediate shifts we focus on the total number of intermediate shifts during the week is always greater by 1 than the total number of intermediate shifts on the weekend.
Warning
Our implementation of this condition is not ideal. The first attempt to penalties intermediate shift on weekday and weekend was effective when used in isolation, but in combination with another objective Free Days near Weekend it did not achieve the desired results. The current implementation does not directly enforce the strict hierachy that is desired.