fix a few more things
This commit is contained in:
@@ -60,17 +60,17 @@ def test_constraint_limit_grades2(limit_constraint_rota):
|
||||
balance_offset=40,
|
||||
workers_required=4,
|
||||
force_as_block=True,
|
||||
constraint=[{"name": "limit_grade_number", "options": {3: 2}}],
|
||||
constraint=[{"name": "limit_grade_number", "options": {3: 1}}],
|
||||
),
|
||||
)
|
||||
Rota.constraint_options["balance_shifts_quadratic"] = True
|
||||
Rota.build_and_solve(options={"ratio": 0.1})
|
||||
Rota.export_rota_to_html("test9")
|
||||
Rota.export_rota_to_html("test9", folder="tests")
|
||||
grade_workers = Rota.get_workers_by_grade()
|
||||
for grade in grade_workers:
|
||||
shift_patterns = [Rota.get_worker_shift_list(w) for w in grade_workers[grade]]
|
||||
zipped_lists = list(zip(*shift_patterns))
|
||||
limit = 2 if grade == 3 else 2
|
||||
limit = 1 if grade == 3 else 3
|
||||
for day_shifts in zipped_lists:
|
||||
assert day_shifts.count("weekday_night") == limit
|
||||
assert Rota.results.solver.status == "ok"
|
||||
|
||||
Reference in New Issue
Block a user