0

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.

lymbot
  • 31
  • 6
  • I don't know why you want to downvote my question, but please let me know why and maybe I can clarify it if you missed something. – lymbot Jan 30 '18 at 11:37

1 Answers1

0

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

lymbot
  • 31
  • 6
  • This is not the best answer. See the answer in the duplicate question https://stackoverflow.com/questions/48538945/access-all-variables-occurring-in-a-pyomo-constraint – jsiirola Jan 31 '18 at 18:40