diff --git a/magisch_corvee_script.py b/magisch_corvee_script.py index 32ea965..24c6236 100755 --- a/magisch_corvee_script.py +++ b/magisch_corvee_script.py @@ -10,7 +10,11 @@ from pyscipopt import Model, quicksum from typing import Any, Tuple, TypeVar from dataclasses import dataclass, field conf = yaml.safe_load(open('config.yaml', 'r')) -config = conf['config'] + +DEFAULT_CONFIG = { + "max_load_person": 6 +} +config = DEFAULT_CONFIG | conf['config'] config['ignore'].append('') QUADRATIC = False @@ -160,7 +164,7 @@ def scipsol(people: dict[str, Person], tasks: dict[str, TaskConfig]): m.addCons(quicksum(does[(pname, d, task)] for d in ALL_DAYS) <= len(ALL_DAYS) - 1) # max_load_person_total - m.addCons(quicksum([does[(pname, d, task)] * tasks[task].workload for d in ALL_DAYS for task in tasks]) <= 6) + m.addCons(quicksum([does[(pname, d, task)] * tasks[task].workload for d in ALL_DAYS for task in tasks]) <= config['max_load_person']) # hardcode constraint for d, task in person.does: