Add support for avoiding shifts on specific dates with reasons

This commit is contained in:
Ross
2026-01-05 22:07:23 +00:00
parent e6bdd4a09e
commit d66ddf29ad
5 changed files with 200 additions and 6 deletions
+4 -2
View File
@@ -49,7 +49,7 @@ def main(
time_to_run: int = 60 * 60 * 4,
ratio: float = 0.001,
start_date: datetime.datetime = "2026-03-02",
weeks: int = 12,
weeks: int = 26,
bom: int = 2,
):
rota_start_date = start_date.date()
@@ -276,7 +276,7 @@ def main(
)
# Prevent shifts for ST2s for 2 weeks
Rota.add_grade_constraint_by_week([2], [1, 2], [shift.name for shift in Rota.shifts])
#Rota.add_grade_constraint_by_week([2], [1, 2], [shift.name for shift in Rota.shifts])
Rota.add_min_summed_grade_by_shifts_per_day_constraint(["weekend_plymouth1", "weekend_plymouth2"], 6)
Rota.add_min_summed_grade_by_shifts_per_day_constraint(["plymouth_twilight", "plymouth_bank_holidays"], 6)
@@ -463,10 +463,12 @@ def main(
print(w)
Rota.add_worker(w)
leave.load_academy(Rota)
# Rota.build_workers()
# Rota.build_model()
solver_options = {"ratio": ratio, "seconds": time_to_run, "threads": 10}
# solver_options = {"seconds": time_to_run, "threads": 10}