Add support for avoiding shifts on specific dates with reasons
This commit is contained in:
+4
-2
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user