|
|
@ -132,6 +132,7 @@ class BasePyomoSolver(InternalSolver):
|
|
|
|
self,
|
|
|
|
self,
|
|
|
|
with_static: bool = True,
|
|
|
|
with_static: bool = True,
|
|
|
|
with_sa: bool = True,
|
|
|
|
with_sa: bool = True,
|
|
|
|
|
|
|
|
with_lhs: bool = True,
|
|
|
|
) -> ConstraintFeatures:
|
|
|
|
) -> ConstraintFeatures:
|
|
|
|
model = self.model
|
|
|
|
model = self.model
|
|
|
|
assert model is not None
|
|
|
|
assert model is not None
|
|
|
@ -162,13 +163,19 @@ class BasePyomoSolver(InternalSolver):
|
|
|
|
senses.append("=")
|
|
|
|
senses.append("=")
|
|
|
|
rhs.append(float(c.upper()))
|
|
|
|
rhs.append(float(c.upper()))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if with_lhs:
|
|
|
|
# Extract LHS
|
|
|
|
# Extract LHS
|
|
|
|
lhsc = []
|
|
|
|
lhsc = []
|
|
|
|
expr = c.body
|
|
|
|
expr = c.body
|
|
|
|
if isinstance(expr, SumExpression):
|
|
|
|
if isinstance(expr, SumExpression):
|
|
|
|
for term in expr._args_:
|
|
|
|
for term in expr._args_:
|
|
|
|
if isinstance(term, MonomialTermExpression):
|
|
|
|
if isinstance(term, MonomialTermExpression):
|
|
|
|
lhsc.append((term._args_[1].name, float(term._args_[0])))
|
|
|
|
lhsc.append(
|
|
|
|
|
|
|
|
(
|
|
|
|
|
|
|
|
term._args_[1].name,
|
|
|
|
|
|
|
|
float(term._args_[0]),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
elif isinstance(term, _GeneralVarData):
|
|
|
|
elif isinstance(term, _GeneralVarData):
|
|
|
|
lhsc.append((term.name, 1.0))
|
|
|
|
lhsc.append((term.name, 1.0))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|