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.
Add a
WithMipGap
trait and implement it for CBC, Cplex, GLPK, and Gurobi.While updating the CBC
command_name
andwith_temp_solution_file
methods I also changed them to copythreads
andseconds
fromself
instead of setting those values toNone
. Most programmers probably expect those methods to retain set values instead of resetting them toNone
.In the CBC
read_specific_solution
method I putbuffer.split_whitespace()
in a variable because the code now needs to callnext()
twice: once to look for"Optimal"
and once to examine what follows to see if the status should beSubOptimal
.In the CBC
arguments
method I replaced the redundant setting of the timeout with the code to set the MIP gap.In the Glpk
arguments
method I got rid of the iterator as suggested for the PR that implemented it. Sinceseconds
andmipgap
have different types I couldn't just add another tuple to the array that was being iterated over.I don't have access to Cplex or Gurobi command line interfaces so I couldn't verify that they work, nor do I know how to recognize when a solution is suboptimal for those solvers. I relied solely on documentation to set the MIP gap arguments.