Skip to content

Commit e8b4593

Browse files
committed
apply patch
1 parent 4ee719c commit e8b4593

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyomo/contrib/appsi/cmodel/src/expression.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,10 @@ appsi_operator_from_pyomo_expr(py::handle expr, py::handle var_map,
15481548
break;
15491549
}
15501550
case param: {
1551-
res = param_map[expr_types.id(expr)].cast<std::shared_ptr<Node>>();
1551+
if (expr.attr("parent_component")().attr("mutable").cast<bool>())
1552+
res = param_map[expr_types.id(expr)].cast<std::shared_ptr<Node>>();
1553+
else
1554+
res = std::make_shared<Constant>(expr.attr("value").cast<double>());
15521555
break;
15531556
}
15541557
case product: {

0 commit comments

Comments
 (0)