diff --git a/solve.py b/solve.py index 4b3c0ee..f598df5 100644 --- a/solve.py +++ b/solve.py @@ -1015,8 +1015,18 @@ def solve( verbose=True, fixed_choices=FIXED_CHOICES, resource_constraints=None, + objective_factors=None, + objective_mode=None, ): + if objective_factors is None: + objective_factors = OBJECTIVE_FACTORS + if objective_mode is None: + objective_mode = OBJECTIVE_MODE + _validate_objective(objective_factors, objective_mode) + # Normalized copy: every key present, missing keys = 0. + obj_factors = {k: objective_factors.get(k, 0) for k in "EBSC"} + # ---- build the city list ----------------------------------------- # cities: list[tuple[int, dict]] where the dict has keys "type" and # "adjacent_to". TODO: adjacency unused; for Industrialist agent.