Not too many consecutive working days
The aim is to minimize consecutive working days that extend to six or more, in order to prevent prolonged periods of work.
Implemented using Google's OR Tools¶
src/cp/objectives/not_too_many_consecutive_days.py
possible_overwork_variables.append(day_phase_variable)
return sum(possible_overwork_variables) * self.weight
For each employee we create variables that show potential day phases that are longer than MAX_CONSECUTIVE_DAYS, which is defined in src/cp/constants.py.
Note
Similar to Minimize Consecutive Night Shifts but without the expontential relation to the length of the phase, allowing longer phases compared to night shifts.