feat: update weeks parameter to 26 and adjust constraint options in RotaBuilder

This commit is contained in:
Ross
2026-07-09 12:06:20 +01:00
parent 13c5ae598a
commit 0861e371e9
+6 -6
View File
@@ -53,7 +53,7 @@ def main(
time_to_run: int = 60 * 60 * 10, time_to_run: int = 60 * 60 * 10,
ratio: float = 0.1, ratio: float = 0.1,
start_date: datetime.datetime = "2026-09-07", start_date: datetime.datetime = "2026-09-07",
weeks: int = 12, weeks: int = 26,
bom: float = 1, bom: float = 1,
): ):
rota_start_date = start_date.date() rota_start_date = start_date.date()
@@ -69,11 +69,11 @@ def main(
Rota.constraint_options["balance_shifts"] = False Rota.constraint_options["balance_shifts"] = False
Rota.constraint_options["balance_shifts_quadratic"] = True Rota.constraint_options["balance_shifts_quadratic"] = True
Rota.constraint_options["balance_weekends"] = True Rota.constraint_options["balance_weekends"] = True
# Rota.constraint_options["max_night_frequency"] = 4 # 3 Rota.constraint_options["max_night_frequency"] = 3 # 3
Rota.constraint_options["max_night_frequency_week_exclusions"] = [] #Rota.constraint_options["max_night_frequency_week_exclusions"] = []
# Rota.constraint_options["max_weekend_frequency"] = 3 Rota.constraint_options["max_weekend_frequency"] = 3
# Rota.constraint_options["max_days_per_week_block"] = [(8,4)] Rota.constraint_options["max_days_per_week_block"] = [(8,4)]
# wr = [ # wr = [
# WorkerRequirement( # WorkerRequirement(
@@ -550,7 +550,7 @@ def main(
# solver_options = {"seconds": time_to_run, "threads": 10} # solver_options = {"seconds": time_to_run, "threads": 10}
# start_time = time.time() # start_time = time.time()
Rota.build_and_solve(solver_options, export=True, solve=solve, solver="appsi_highs") Rota.build_and_solve(solver_options, export=True, solve=solve, solver="appsi_highs", export_with_timestamp=True)
# Rota.solve_shifts_by_block(solver_options, block_length=13) # Rota.solve_shifts_by_block(solver_options, block_length=13)
# Rota.solve_shifts_individually(solver_options) # Rota.solve_shifts_individually(solver_options)