Organize test fixtures; handle infeasibility in DropRedundant

This commit is contained in:
2021-02-02 10:24:51 -06:00
parent 8153dfc825
commit 31ca45036a
10 changed files with 112 additions and 51 deletions

View File

@@ -32,7 +32,7 @@ class DropRedundantInequalitiesStep(Component):
classifier=CountingClassifier(),
threshold=0.95,
slack_tolerance=1e-5,
check_feasibility=False,
check_feasibility=True,
violation_tolerance=1e-5,
max_iterations=3,
):
@@ -208,6 +208,8 @@ class DropRedundantInequalitiesStep(Component):
return False
if self.current_iteration >= self.max_iterations:
return False
if solver.internal_solver.is_infeasible():
return False
self.current_iteration += 1
logger.debug("Checking that dropped constraints are satisfied...")
constraints_to_add = []