fix a few more things
This commit is contained in:
@@ -37,7 +37,7 @@ def main(
|
||||
solve: bool = True,
|
||||
time_to_run: int = 60 * 60,
|
||||
ratio: float = 0.001,
|
||||
start_date: datetime.datetime = "2025-03-03",
|
||||
start_date: datetime.datetime = "2025-09-01",
|
||||
weeks: int = 26,
|
||||
bom: int = 1,
|
||||
):
|
||||
@@ -60,16 +60,16 @@ def main(
|
||||
Rota.constraint_options["hard_constrain_pair_separation"] = True
|
||||
# Rota.constraint_options["avoid_st2_first_month"] = True
|
||||
|
||||
wr = [
|
||||
WorkerRequirement(
|
||||
end_date=datetime.datetime.strptime("2025-06-02", "%Y-%m-%d").date(),
|
||||
number=3,
|
||||
),
|
||||
WorkerRequirement(
|
||||
start_date=datetime.datetime.strptime("2025-06-02", "%Y-%m-%d").date(),
|
||||
number=4,
|
||||
),
|
||||
]
|
||||
#wr = [
|
||||
# WorkerRequirement(
|
||||
# end_date=datetime.datetime.strptime("2025-06-02", "%Y-%m-%d").date(),
|
||||
# number=3,
|
||||
# ),
|
||||
# WorkerRequirement(
|
||||
# start_date=datetime.datetime.strptime("2025-06-02", "%Y-%m-%d").date(),
|
||||
# number=4,
|
||||
# ),
|
||||
#]
|
||||
|
||||
Rota.add_shifts(
|
||||
SingleShift(
|
||||
@@ -226,7 +226,7 @@ def main(
|
||||
balance_offset=3.9,
|
||||
balance_weighting=1,
|
||||
# hard_constrain_shift=False,
|
||||
workers_required=wr,
|
||||
workers_required=4,
|
||||
force_as_block=True,
|
||||
rota_on_nwds=True,
|
||||
constraint=[
|
||||
@@ -256,7 +256,7 @@ def main(
|
||||
balance_offset=2.9,
|
||||
balance_weighting=1,
|
||||
# hard_constrain_shift=False,
|
||||
workers_required=wr,
|
||||
workers_required=4,
|
||||
force_as_block=True,
|
||||
rota_on_nwds=True,
|
||||
constraint=[
|
||||
@@ -330,6 +330,8 @@ def main(
|
||||
|
||||
# Rota.add_grade_constraint_by_week([2], [1, 2], ["night_weekday", "night_weekend"])
|
||||
|
||||
Rota.add_min_summed_grade_by_shifts_per_day_constraint(["weekend_plymouth1", "weekend_plymouth2"], 6)
|
||||
|
||||
load_leave = True
|
||||
Rota.build_shifts()
|
||||
# Rota.add_grade_constraint_by_week([2], [1], Rota.get_shift_names())
|
||||
@@ -341,10 +343,17 @@ def main(
|
||||
|
||||
n = 0
|
||||
for worker in workers:
|
||||
n = n + 1
|
||||
worker_name = worker
|
||||
|
||||
if worker_name == "Name":
|
||||
continue
|
||||
n = n + 1
|
||||
w = workers[worker]
|
||||
site = w["site"]
|
||||
try:
|
||||
site = w["site"]
|
||||
except KeyError:
|
||||
print(f"Worker {worker} has no site")
|
||||
raise KeyError
|
||||
grade = w["grade"]
|
||||
try:
|
||||
fte = float(w["fte"]) * 100
|
||||
@@ -481,7 +490,7 @@ def main(
|
||||
w = Worker(
|
||||
name=worker_name,
|
||||
site=site.lower(),
|
||||
grade=int(grade[2]),
|
||||
grade=int(grade),
|
||||
id=n,
|
||||
fte=int(fte),
|
||||
nwds=nwds,
|
||||
|
||||
Reference in New Issue
Block a user