Don't require priority attribute on models.

This commit is contained in:
Todd Gamblin 2023-02-22 10:53:16 -08:00
parent 7e8fb4b8d0
commit 2c7a2fa3e0
No known key found for this signature in database
GPG Key ID: C16729F1AACF66C6

View File

@ -758,7 +758,8 @@ def visit(node):
cores = [] # unsatisfiable cores if they do not
def on_model(model):
models.append((model.cost, model.priority, model.symbols(shown=True, terms=True)))
priorities = getattr(model, "priority", None)
models.append((model.cost, priorities, model.symbols(shown=True, terms=True)))
solve_kwargs = {
"assumptions": self.assumptions,
@ -800,8 +801,6 @@ def on_model(model):
depths = extract_functions(best_model, "depth")
max_depth = max(d.args[1] for d in depths)
print("PRIO:", priorities)
result.criteria = build_criteria_names(min_cost, criteria, max_depth)
# record the number of models the solver considered