Foggalong / RobustOCS

Robust optimal contirbution selection problems for genetics with Python
https://pypi.org/project/robustocs
MIT License
1 stars 0 forks source link

Assess active constraints with HiGHS #13

Closed Foggalong closed 2 months ago

Foggalong commented 2 months ago

In the Gurobi methods we have a little snippet which examines which constraints are currently active, then if debugging is on reports that back to the user.

active_const: bool = False
for c in model.getConstrs():
    if abs(c.Slack) > robust_gap_tol:
        active_const = True
        if debug:
            print(f"{c.ConstrName} active, slack {c.Slack:g}")
if debug and not active_const:
    print("No active constraints!")

Similar was originally intended as part of #10, but wasn't essential to get the model working. It would be nice to implement the same in HiGS using getBasis (see Python and fuller C docs).