mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Make lazy constr component compatible with Pyomo+Gurobi
This commit is contained in:
@@ -53,7 +53,12 @@ class PyomoModel(AbstractModel):
|
||||
assert (
|
||||
self.solver_name == "gurobi_persistent"
|
||||
), "Callbacks are currently only supported on gurobi_persistent"
|
||||
_gurobi_add_constr(self.solver, self.where, constr)
|
||||
if self.where in [AbstractModel.WHERE_CUTS, AbstractModel.WHERE_LAZY]:
|
||||
_gurobi_add_constr(self.solver, self.where, constr)
|
||||
else:
|
||||
# outside callbacks, add_constr shouldn't do anything, as the constraint
|
||||
# has already been added to the ConstraintList object
|
||||
pass
|
||||
|
||||
def add_constrs(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user