Add constraints for maximum days and unique shifts per week block in worker model
This commit is contained in:
+3
-1
@@ -15,7 +15,7 @@ from rota_generator.workers import (
|
||||
NonWorkingDays,
|
||||
WorkRequests,
|
||||
PreferenceNotToWork,
|
||||
OutOfProgramme,
|
||||
OutOfProgramme, MaxUniqueShiftsPerWeekBlockConstraint,
|
||||
)
|
||||
|
||||
from loguru import logger
|
||||
@@ -465,6 +465,8 @@ def load_workers():
|
||||
else:
|
||||
w.add_hard_day_dependency({"Fri", "Sun"})
|
||||
w.add_hard_day_exclusion({"Sat", "Sun"})
|
||||
else:
|
||||
w.max_unique_shifts_per_week_block = [MaxUniqueShiftsPerWeekBlockConstraint(week_block=1, max_unique_shifts=1)]
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user