问题
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