latest rotas

This commit is contained in:
Ross
2025-07-07 17:49:21 +01:00
parent adccf8211c
commit cf48c3c168
2 changed files with 48 additions and 19 deletions
+14 -12
View File
@@ -19,8 +19,6 @@ sites = (
"proc", "proc",
) )
NIGHT_REGISTRAR_NUMBER = 4
from rota.workers import ( from rota.workers import (
Worker, Worker,
NotAvailableToWork, NotAvailableToWork,
@@ -35,7 +33,7 @@ from rota.workers import (
def main( def main(
suspend: bool = False, suspend: bool = False,
solve: bool = True, solve: bool = True,
time_to_run: int = 60 * 60, time_to_run: int = 60 * 60 * 4,
ratio: float = 0.001, ratio: float = 0.001,
start_date: datetime.datetime = "2025-09-01", start_date: datetime.datetime = "2025-09-01",
weeks: int = 16, weeks: int = 16,
@@ -425,16 +423,20 @@ def main(
shift_fte_overrides = {} shift_fte_overrides = {}
if worker_name == "Ben Kemp": #if worker_name == "Ben Kemp":
# shift_fte_overrides = {
# "plymouth_twilight": 100,
# "weekend_plymouth1": 50,
# "weekend_plymouth2": 50,
# }
#elif worker_name == "Joel Lim":
# shift_fte_overrides = {
# "plymouth_twilight": 100,
# "weekend_exeter": 50,
# }
if worker_name == "Nang Thiriphoo":
shift_fte_overrides = { shift_fte_overrides = {
"plymouth_twilight": 100, "weekend_exeter": 40,
"weekend_plymouth1": 50,
"weekend_plymouth2": 50,
}
elif worker_name == "Joel Lim":
shift_fte_overrides = {
"plymouth_twilight": 100,
"weekend_exeter": 50,
} }
w = Worker( w = Worker(
+34 -7
View File
@@ -29,7 +29,7 @@ def main(
time_to_run: int = 60 * 60, time_to_run: int = 60 * 60,
ratio: float = 0.001, ratio: float = 0.001,
start_date: datetime.datetime = "2025-09-01", start_date: datetime.datetime = "2025-09-01",
weeks: int = 12, weeks: int = 22,
bom: int = 1, bom: int = 1,
): ):
rota_start_date = start_date.date() rota_start_date = start_date.date()
@@ -53,7 +53,7 @@ def main(
name="oncall", name="oncall",
length=12.5, length=12.5,
days=days, days=days,
balance_offset=5, balance_offset=2,
assign_as_block=False, assign_as_block=False,
constraint=[ constraint=[
#{ #{
@@ -84,8 +84,8 @@ def main(
days=days[5:], days=days[5:],
balance_offset=2, balance_offset=2,
constraint=[ constraint=[
{"name": "pre", "options": 2}, {"name": "pre", "options": 1},
{"name": "post", "options": 2}, {"name": "post", "options": 1},
], ],
display_char="b", display_char="b",
), ),
@@ -137,13 +137,40 @@ def main(
w.add_hard_day_dependency("Fri", "Sat", "Sun") w.add_hard_day_dependency("Fri", "Sat", "Sun")
else: else:
w.add_hard_day_dependency("Fri", "Sun") w.add_hard_day_dependency("Fri", "Sun")
## #w.add_hard_day_dependency("Sat", "Sun") #w.set_max_shifts_per_week("weekend", 1)
# #w.add_hard_day_dependency("Sat", "Sun")
print(w) print(w)
Rota.add_worker(w) Rota.add_worker(w)
for w in range(12, 21): w13 = Worker(name=f"A13", site="rota a", grade=1, start_date="2025-10-01")
#w.prefer_multi_shift_together = 10
#w.allow_shifts_together("oncall", "twilight")
#w.allow_shifts_together("oncall", "weekend")
#w.add_hard_day_dependency("Fri", "Sat", "Sun")
w13.add_force_assign_with("twilight", "oncall")
w13.add_force_assign_with("weekend", "oncall")
#w.set_max_shifts_per_week("twilight", 1)
Rota.add_worker(w13)
w13 = Worker(name=f"A14", site="rota a", grade=1, start_date="2025-12-01")
#w.prefer_multi_shift_together = 10
#w.allow_shifts_together("oncall", "twilight")
#w.allow_shifts_together("oncall", "weekend")
#w.add_hard_day_dependency("Fri", "Sat", "Sun")
w13.add_force_assign_with("twilight", "oncall")
w13.add_force_assign_with("weekend", "oncall")
#w.set_max_shifts_per_week("twilight", 1)
Rota.add_worker(w13)
for w in range(14, 24):
w = Worker( w = Worker(
name=f"B{w}", name=f"B{w}",
site="rota b", site="rota b",
@@ -155,7 +182,7 @@ def main(
], ],
) )
#w.add_hard_day_exclusion("Sat", "Sun") #w.add_hard_day_exclusion("Sat", "Sun")
w.set_max_shifts_per_week("twilight", 1) w.set_max_shifts_per_week("twilight", 2)
w.set_max_shifts_per_week("weekend b", 1) w.set_max_shifts_per_week("weekend b", 1)
print(w) print(w)