Pyomo:错误:运行模型时出现意外异常:列表索引超出范围

时间:2018-05-31 16:41:31

标签: python modeling pyomo

所以我正在使用Pycharm在Pyomo中创建一个模型。当我在Pycharm中运行模型(以测试语法是否正常等)时,我不会犯任何错误,但如果我使用“pyomo solve --solver = glpk --stream-solver --summary运行cmd model.py“我得到以下输出

[    0.00] Setting up Pyomo environment
[    0.00] Applying Pyomo preprocessing actions
[    0.47] Creating model
[    0.47] Applying solver
GLPSOL: GLPK LP/MIP Solver, v4.57
Parameter(s) specified in the command line:
 --write C:\Users\Usuario\PycharmProjects\untitled\tmpppxfx743.glpk.raw --wglp
 C:\Users\Usuario\PycharmProjects\untitled\tmpsykfeh2b.glpk.glp --cpxlp C:\Users\Usuario\PycharmProjects\untitled\tmp9ogdtp4l.pyomo.lp
Reading problem data from 'C:\Users\Usuario\PycharmProjects\untitled\tmp9ogdtp4l.pyomo.lp'...
C:\Users\Usuario\PycharmProjects\untitled\tmp9ogdtp4l.pyomo.lp:42834: warning: lower bound of variable 'x2017' redefined
C:\Users\Usuario\PycharmProjects\untitled\tmp9ogdtp4l.pyomo.lp:42834: warning: upper bound of variable 'x2017' redefined
7105 rows, 2953 columns, 18462 non-zeros
936 integer variables, all of which are binary
43770 lines were read
Writing problem data to 'C:\Users\Usuario\PycharmProjects\untitled\tmpsykfeh2b.glpk.glp'...
36501 lines were written
GLPK Integer Optimizer, v4.57
7105 rows, 2953 columns, 18462 non-zeros
936 integer variables, all of which are binary
Preprocessing...
LP RELAXATION HAS NO DUAL FEASIBLE SOLUTION
Time used:   0.0 secs
Memory used: 4.3 Mb (4478268 bytes)
Writing MIP solution to 'C:\Users\Usuario\PycharmProjects\untitled\tmpppxfx743.glpk.raw'...
10060 lines were written

[    0.93] Processing results
    Number of solutions: 0
    Solver results file: results.yml

==========================================================
Solution Summary
==========================================================
[    0.93] Pyomo Finished

**ERROR: Unexpected exception while running model:
        list index out of range**

有人知道可能是什么情况吗?我不确定它是否可能是不可行的(如何在输出中说出来),因为错误消息不适合这种问题。

感谢您的帮助!

0 个答案:

没有答案
相关问题