How to use pyomo to load *.sol file

不羁岁月 提交于 2019-12-24 10:37:43

问题


I use pyomo to write the script, but use external solver to do the optimization.

The external solver return a *.sol file. My question is that if pyomo or any package of python can decode the sol file, and pass the decision variable result into the original model. Therefore, we can do some post analysis.


回答1:


I wanted to add this as a comment but I dont have enough reputation.

I was facing a similar problem with CPLEX. See this question. You have to basically store the variable map and use it while parsing the solution file. In my case CPLEX gives solution in XML format, so I used XML parser.

Hope this helps!



来源:https://stackoverflow.com/questions/54399238/how-to-use-pyomo-to-load-sol-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!