Skip to content

Rounds (Visiten)

In the early shift, at least one employee must conduct a round. Employees need to have a proper qualification to conduct a round. Therefore, at least one qualified employee needs to be assigned to an early shift on workdays.

Implemented using Google's OR Tools

src/cp/constraints/rounds_in_early_shift.py
early_shift_variables = [
    variables[
        EmployeeDayShiftVariable.get_key(
            employee, day, self._shifts[Shift.EARLY]
        )
    ]
    for employee in qualified_employees
]

model.add_at_least_one(early_shift_variables)

For each day we collect the early shift variables of all qualified employee (see cases/{case_id}/general_settings.json) and restrict the model to solution where at least one of them are true.