简体   繁体   中英

Pyomo-Solver Communication

I was wondering what information is passed by the pyomo script to the solver (eg Cbc). In specific, I want to ask whether, whatever constraints and objective function I code, does the solver ask python to do the computation of these functions or are they done in the language the solver is written.

Computations are done in the language the solver is written in. In most cases Pyomo takes your model and will output it to a file using the .lp or .nl format for linear and nonlinear models respectively. The solver will read the file, create its own representation of the model, solve the problem, and write a .sol file with the solution. Pyomo will then read the .sol file and load the solution back into the Pyomo model in Python. The one exception to this workflow is if you're using the direct or persistent interface to Gurobi. In that case no files are written but I believe all the computations are still done in the language of the solver.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM