在Python的Pymo扩展上安装Couenne解算器

2024-04-27 19:15:10 发布

您现在位置:Python中文网/ 问答频道 /正文

如何安装Pyomo的“Cuenne”优化器扩展?我已经从:https://www.coin-or.org/download/binary/Couenne/下载了二进制文件

以下是Pyomo网站上关于如何使用ASL解决问题的官方指南:

The basic work flow that takes place above can be summarized as:

Create an ASL solver plugin that uses the ipopt executable appearing in the shell search PATH.

Output the Pyomo model as an NL file. Invoke the solver (which produces an SOL file).

Check the solver termination condition stored in the results object.

Load the solution stored in the results object into the Pyomo model.Construct a Pyomo model.

Solve the PyomoRead the SOL file into a Pyomo results object.

http://nbviewer.jupyter.org/github/Pyomo/PyomoGallery/blob/master/asl_io/asl_io.ipynb

但它根本没有详细说明如何让Pyomo识别Couenne解算器。在


Tags: theinorganmodelthatobjectas
2条回答

必须确保Couenne可执行文件位于PATH环境变量中。如果您可以打开一个终端并键入couenne并获得以下输出,您将知道这是正确的:

$ couenne
Couenne 0.5.6   an Open-Source solver for Mixed Integer Nonlinear Optimization
Mailing list: couenne@list.coin-or.org
Instructions: http://www.coin-or.org/Couenne
No stub!
usage: couenne [options] stub [-AMPL] [<assignment> ...]

Options:
       {end of options}
    -=  {show name= possibilities}
    -?  {show usage}
    -bf {read boundsfile f}
    -e  {suppress echoing of assignments}
    -of {write .sol file to file f}
    -s  {write .sol file (without -AMPL)}
    -v  {just show version}

同样,您应该打开一个终端并验证Pyomo是否已成功安装。一旦您验证了这两件事,那么您就可以通过指定'couenne'作为解算器来使用Pyomo中的Couenne。在

对于那些在实践中挣扎的人来说,贝萨尼的答案意味着什么(就像我一样)。复制库恩.exe把文件放在与例如相同的文件夹中。ipopt.exe文件(例如:C:\ProgramData\Anaconda3\Library\bin)

相关问题 更多 >