mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
PyomoSolver: Never query values of fixed variables
This commit is contained in:
@@ -54,6 +54,8 @@ class BasePyomoSolver(InternalSolver):
|
|||||||
for var in self.model.component_objects(Var):
|
for var in self.model.component_objects(Var):
|
||||||
solution[str(var)] = {}
|
solution[str(var)] = {}
|
||||||
for index in var:
|
for index in var:
|
||||||
|
if var[index].fixed:
|
||||||
|
continue
|
||||||
solution[str(var)][index] = var[index].value
|
solution[str(var)][index] = var[index].value
|
||||||
return solution
|
return solution
|
||||||
|
|
||||||
@@ -66,6 +68,8 @@ class BasePyomoSolver(InternalSolver):
|
|||||||
for var in self.model.component_objects(Var):
|
for var in self.model.component_objects(Var):
|
||||||
variables[str(var)] = []
|
variables[str(var)] = []
|
||||||
for index in var:
|
for index in var:
|
||||||
|
if var[index].fixed:
|
||||||
|
continue
|
||||||
variables[str(var)] += [index]
|
variables[str(var)] += [index]
|
||||||
return variables
|
return variables
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user