Add efficiency for handling PyROS separation problem sub-solver errors #3441
+256
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary/Motivation:
PyROS currently terminates with a
subsolver_error
status when user-supplied sub-solvers fail to successfully solve a separation problem. However, the PyROS algorithm can potentially recover from these separation problem sub-solver errors by moving to the next iteration using violated constraints from the set of successfully solved separation problems. Here, PyROS should continue solving as long as constraint violations are found and either terminate successfully (if the final iteration contains nosubsolver_error
) or terminate withsubsolver_error
(if the final iteration contains asubsolver_error
and no performance constraints are violated). This efficiency may improve PyROS's robustness and help to successfully solve problems that currently terminate immediately withsubsolver_error
.Changes proposed in this PR:
SeparationLoopResults.subsolver_error
to check if violations were found in the separation loop.subsolver_error=True
for the separation loop only when no other violations are found.DiscreteSeparationSolveCallResult.subsolver_error
to check if all scenarios hadsubsolver_error
.subsolver_error=True
only if all scenarios failed to solve.discrete_solve
andget_worst_discrete_separation_solution
to handle potential sub-solver errors without causing PyROS to terminate immediatelyTestPyROSSubsolverErrorEfficiency
Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: