问题
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 for that purpose.
回答1:
I found the answer myself: model.con1.body._args
gets you the desired list.
来源:https://stackoverflow.com/questions/48519905/how-to-get-variables-of-a-constraint-in-pyomo