GurobiSolver: Implement relax/enforce constraint

This commit is contained in:
2021-04-15 15:22:12 -05:00
parent 4dd4ef52bd
commit 0ba8cc16fd
7 changed files with 96 additions and 16 deletions

View File

@@ -386,7 +386,9 @@ class BasePyomoSolver(InternalSolver):
]
@overrides
def is_constraint_satisfied(self, constr: Constraint, tol: float = 1e-6) -> bool:
def is_constraint_satisfied_old(
self, constr: Constraint, tol: float = 1e-6
) -> bool:
lhs = 0.0
assert constr.lhs is not None
for (varname, coeff) in constr.lhs.items():