Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
1.97k stars 504 forks source link

baron_writer AttributeError when switching from *.nl to *.bar interface #1051

Closed JoergBentz closed 5 years ago

JoergBentz commented 5 years ago

Dear Pyomo-Team,

when try to solve a pretty simple MINLP model with the bonmin solver, everything works pretty fine. But when I change to the baron solver, the baron_writer throws me an Error:

File "C:\ProgramData\Anaconda3\lib\site-packages\pyomo\repn\plugins\baron_writer.py", line 81, in visit parens = node._associativity() != 1 AttributeError: '_GeneralExpressionData' object has no attribute '_associativity'

I can get rid of the error when I reduce the complexity of the interleaved expressions of the model. But of course then I do not have fullfilled the optimizetion goal.

Many greetings

Joerg

Bonmin_Log.txt

jsiirola commented 5 years ago

This was resolved by #1031 and should be available in the current release. Upgrading to Pyomo 5.6.4 should resolve your problem. Please reopen this issue if 5.6.4 doesn't fix things.