Pyomo - CPLEX returns 无解、无约束、无变量

Pyomo - CPLEX returns no solutions, no constraints, no variables

我刚开始使用 Pyomo。我尝试在 Ubuntu 14.06.

上使用 CPLEX 12.8、Python 3.6 解决 Pyomo Overview 中的示例问题
# abstract1.py
from __future__ import division
from pyomo.environ import *

model = AbstractModel()

model.m = Param(within=NonNegativeIntegers)
model.n = Param(within=NonNegativeIntegers)

model.I = RangeSet(1, model.m)
model.J = RangeSet(1, model.n)

model.a = Param(model.I, model.J)
model.b = Param(model.I)
model.c = Param(model.J)

# the next line declares a variable indexed by the set J
model.x = Var(model.J, domain=NonNegativeReals)

def obj_expression(model):
    return summation(model.c, model.x)

model.OBJ = Objective(rule=obj_expression)

def ax_constraint_rule(model, i):
    # return the expression for the constraint for i
    return sum(model.a[i,j] * model.x[j] for j in model.J) >= model.b[i]

# the next line creates one constraint for each member of the set model.I
model.AxbConstraint = Constraint(model.I, rule=ax_constraint_rule)

# abstract1.dat
param m := 1 ;
param n := 2 ;

param a :=
1 1 3
1 2 4
;

param c:=
1 2
2 3
;

param b := 1 1 ;

运行这个 $ pyomo solve abstract1.py abstract1.dat --solver=cplex 但是,returns无解。事实上,该模型似乎没有约束也没有变量,并产生以下结果。

# ==========================================================
# = Solver Results                                         =
# ==========================================================
# ----------------------------------------------------------
#   Problem Information
# ----------------------------------------------------------
Problem: 
- Lower bound: -inf
  Upper bound: inf
  Number of objectives: 1
  Number of constraints: 0
  Number of variables: None
  Number of nonzeros: None
  Sense: unknown
# ----------------------------------------------------------
#   Solver Information
# ----------------------------------------------------------
Solver: 
- Status: ok
  Termination condition: unknown
  Error rc: 0
  Time: 0.01150965690612793

我已经尝试了 ConcreteModel 示例,以及 abstract2.py,但仍然得到上述结果。任何人都知道发生了什么,或者我可以在哪里查看?

我被指向 this solution。这是一个愚蠢的错误,我的工作目录名称中有一个 space(例如 'two Words')。摆脱 space 应该是开发人员的标准做法(我不是受过培训的开发人员)(例如,'twoWords')解决了这个问题。