.
This commit is contained in:
@@ -27,20 +27,20 @@ from rota.workers import (
|
||||
|
||||
suspend_on_finish = True
|
||||
solve = True
|
||||
time_to_run = 508500
|
||||
#time_to_run = 508500
|
||||
#time_to_run = 2660000
|
||||
time_to_run = 400
|
||||
# allow = 5000
|
||||
time_to_run = 5000
|
||||
#allow = 5000
|
||||
ratio = 0.01
|
||||
#ratio = 0.9
|
||||
|
||||
|
||||
start_date = datetime.date(2023, 3, 6)
|
||||
start_date = datetime.date(2023, 9, 4)
|
||||
#start_date = datetime.date(2023, 5, 1)
|
||||
#start_date = start_date + datetime.timedelta(weeks=13)
|
||||
# start_date = datetime.date(2022, 10, 10)
|
||||
|
||||
Rota = RotaBuilder(start_date, weeks_to_rota=26, balance_offset_modifier=1)
|
||||
Rota = RotaBuilder(start_date, weeks_to_rota=14, balance_offset_modifier=1)
|
||||
#Rota = RotaBuilder(start_date, weeks_to_rota=20, balance_offset_modifier=1)
|
||||
Rota.constraint_options["balance_weekends"] = True
|
||||
Rota.constraint_options["max_night_frequency"] = 3 # 3
|
||||
@@ -104,8 +104,8 @@ Rota.add_shifts(
|
||||
length=12.5,
|
||||
days=days[4:],
|
||||
balance_offset=3,
|
||||
rota_on_nwds=True,
|
||||
force_as_block=True,
|
||||
rota_on_nwds=False,
|
||||
assign_as_block=True,
|
||||
constraint=[{"name": "pre", "options": 2}, {"name": "post", "options": 2}],
|
||||
# force_as_block_unless_nwd=True
|
||||
),
|
||||
@@ -260,7 +260,7 @@ if load_leave:
|
||||
for dates in oop.split(","):
|
||||
s, e = dates.split("-")
|
||||
formatted_oops.append(
|
||||
{"start_date": datetime.datetime.strptime(s, "%d/%m/%y").date(), "end_date": datetime.datetime.strptime(e, "%d/%m/%y").date()}
|
||||
{"start_date": datetime.datetime.strptime(s.strip(), "%d/%m/%y").date(), "end_date": datetime.datetime.strptime(e.strip(), "%d/%m/%y").date()}
|
||||
)
|
||||
|
||||
oop = formatted_oops
|
||||
@@ -330,7 +330,7 @@ solver_options = {"ratio": ratio, "seconds": time_to_run, "threads": 10}
|
||||
|
||||
start_time = time.time()
|
||||
Rota.build_and_solve(solver_options)
|
||||
#Rota.solve_shifts_by_block(solver_options, block_length=10)
|
||||
#Rota.solve_shifts_by_block(solver_options, block_length=13)
|
||||
#Rota.solve_shifts_individually(solver_options)
|
||||
# Rota.solve_model(options=solver_options)
|
||||
end_time = time.time()
|
||||
|
||||
Reference in New Issue
Block a user