CPLEX OPL 错误运行时:不要键入 lloType,

CPLEX OPL ERROR RUNTIME : not to type lloType ,

令人困惑;我不知道是什么问题。有人知道问题出在哪里吗?当我 运行 CPLEX.i 中的代码时,我的 objective 函数中的某些表达式出现此错误,“opl not to type runtime error”我正在研究一个调度问题设计的论文,因此它适合 A2 是死路,我收到一个错误,我无法用字符串输出结果,请帮我查看代码,我将非常感谢我的代码如下:

`int numLocomotive=...;
range RangeLocomotive=1..numLocomotive;
{string} Pij=...;
{string} Node=...;
{string} Locomotive=...;{string} Vd=...;
{string} Va=...;
{string} Vs=...;
{string} Vf=...;
{string} Exp= Va union Vs;
{string} Exp= Va union Vs;
{string} Exp= Va union Vs;
{string} V= Vd union Va union Vs;
int ckm=...;
int cloc=...;
tuple A{
string I;
string j;
}
  {A} A2 ={<i,j> | ordered i,j in Node};
  int dis=...;
  dvar boolean x[<i,j> in A2];
  dvar boolean s[Locomotive];
 dvar boolean q[Node][Locomotive];


  execute PRE_SETUP
 {
  cplex.epgap = 0.001;
  cplex.tilim = 21600;
  }

  dexpr float Totalcost = sum(<i,j> in A2)(dis*x[<i,j>])*ckm + sum(k in Locomotive)s[k]*cloc;
  minimize Totalcost;

  subject to{
 ct01:
forall(j in Vd)
 sum(<i,j> in A2) x[<i,j>] == 1;

ct02:
 forall(i in Exp)
  sum(<i,j> in A2) x[<i,j>] == 1;

 ct03:
 forall(j in Vf)
   sum(<i,j> in A2) x[<i,j>] == numLocomotive;   

 ct04:
 forall(<i,j> in A2, k in Locomotive)

   s[k] + x[<i,j>] == 1;

 ct05:
 forall(i in Node, k in Locomotive)
  q[i][k] == 1;

  ct06:
 forall(i in V)
 sum(k in Locomotive, i in Node) q[i][k] == 1;

ct07:
forall(i in Node, j in Node, k in Locomotive: k in Pij)
   q[i][k] == q[j][k];
  forall(i in Node, j in Node, k in Locomotive: k not in Pij)  
   q[i][k] + q[j][k] == 0;  

  ct08:
    forall(<i,j> in A2, k in Locomotive)
   q[j][k] >= q[i][k] - (1-x[<i,j>]);
}    

我的数据

     `numLocomotive=2;
      ckm=10;
       cloc=300;
       Node={"S","K","V","Vi","Va","B","E"};
      Locomotive={"L1","L2"};
       Vd={"S","K","V"};
      Va={"V","Vi","Va","B"};
       Vs={"S";"K"};
       Vf={"E"};
       Pij={<L1 L2> <L1 L2> <L1 L2> <L1 L2>};
    
    A1
    i  S   K   V   S 
    j  V   Vi  Va  B

    A2
    i  S   S   S    k   k   k
    j  S   Vi   K   S   K   V
 Dis   50  45  40  56  50   59
    ckm=10;
    cloc=300;  ` 


 

.mod

int numLocomotive=...;
range RangeLocomotive=1..numLocomotive;

{string} Node=...;
{string} Locomotive=...;{string} Vd=...;
{string} Va=...;
{string} Vs=...;
{string} Vf=...;
{string} Exp= Va union Vs;

{string} V= Vd union Va union Vs;
int ckm=...;
int cloc=...;
tuple A{
string I;
string j;
}

{A} Pij=...;

{string} ij={k.I | k in Pij} union {k.j | k in Pij};


  {A} A2 ={<i,j> | ordered i,j in Node};
  int dis=...;
  dvar boolean x[<i,j> in A2];
  dvar boolean s[Locomotive];
 dvar boolean q[Node][Locomotive];


  execute PRE_SETUP
 {
  cplex.epgap = 0.001;
  cplex.tilim = 21600;
  }

  dexpr float Totalcost = sum(<i,j> in A2)(dis*x[<i,j>])*ckm + sum(k in Locomotive)s[k]*cloc;
  minimize Totalcost;

  subject to{
 ct01:
forall(j in Vd)
 sum(<i,j> in A2) x[<i,j>] == 1;

ct02:
 forall(i in Exp)
  sum(<i,j> in A2) x[<i,j>] == 1;

 ct03:
 forall(j in Vf)
   sum(<i,j> in A2) x[<i,j>] == numLocomotive;   

 ct04:
 forall(<i,j> in A2, k in Locomotive)

   s[k] + x[<i,j>] == 1;

 ct05:
 forall(i in Node, k in Locomotive)
  q[i][k] == 1;

  ct06:
 forall(i in V)
 sum(k in Locomotive, i in Node) q[i][k] == 1;

ct07:
forall(i in Node, j in Node, k in Locomotive: k in ij)
   q[i][k] == q[j][k];
  forall(i in Node, j in Node, k in Locomotive: k not in ij)  
   q[i][k] + q[j][k] == 0;  

  ct08:
    forall(<i,j> in A2, k in Locomotive)
   q[j][k] >= q[i][k] - (1-x[<i,j>]);
} 

.dat

numLocomotive=2;
      ckm=10;
       cloc=300;
       Node={"S","K","V","Vi","Va","B","E"};
      Locomotive={"L1","L2"};
       Vd={"S","K","V"};
      Va={"V","Vi","Va","B"};
       Vs={"S","K"};
       Vf={"E"};
       Pij={<L1 L2> <L1 L2>, <L1 L2> <L1 L2>};
       dis=2;

工作正常