How to get variables of a constraint in Pyomo

后端 未结 1 1168
春和景丽
春和景丽 2021-01-29 06:26

In Pyomo, how can I get a list of the variables appearing in a constraint?

I combed through the code in Github, but could not a find any suitable method or attribute fo

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-29 07:10

    I found the answer myself: model.con1.body._args gets you the desired list.

    0 讨论(0)
提交回复
热议问题