CPLEX:运行OPL时出现太多错误

时间:2019-03-29 15:57:36

标签: cplex

我是CPLEX 12.8的初学者。我尝试运行OPL模型,它出现了51个错误,其中包括“ CPLEX无法提取表达式”,“数组索引超出范围”,最后出现“错误太多,放弃了50个错误”。

这是模型中显示错误的部分:

forall(p in plant, k1 in truck, k2 in truck, j1 in jobs, j2 in jobs)
  start_load[p][k1][j1]+load_time[k1][j1] <= start_load[p][k2][j2];
forall (k in truck,j in jobs)
      sum(p in plant,r in request,m in deliveries)
        x[p][r][m][k][j+1] <=
      sum(p in plant,r in request,m in deliveries)
        x[p][r][m][k][j] ;
forall(p in plant,r in request)
      travel_time_r[p][r] == (distance_r[p][r])/velocity ;

我的.dat .mod在这里:

https://drive.google.com/open?id=18CVA8zTbPWrHXy5E2vHaLskuTcXeHNs-

我如何调试此模型。预先谢谢你。

编辑

ct8 : forall(p1 in plant, p2 in plant, r in request, k in truck, j in jobs : j == j0)
      sum(m in deliveries : (j+1) in jobs)
        x[p1][r][m][k][j]*end_pour[k][j] <= arrive_plant[p2][k][j+1]+(base[p2][k]*travel_time_r[p][r]);
ct19 : forall(p1 in plant, p2 in plant, r1 in request, r2 in request,k in truck, j in jobs : j != j0)
        end_pour[k][j] <= 
      (sum(m1 in deliveries, m2 in deliveries : (j+1) in jobs)
        x[p1][r1][m1][k][j]*x[p2][r2][m2][k][j+1]*travel_time_r[p2][r1])+arrive_plant[p2][k][j+1];

1 个答案:

答案 0 :(得分:1)

您需要解决一些问题。

让我给你举个例子:

您写了

ct3 : forall (k in truck,j in jobs)
      sum(p in plant,r in request,m in deliveries)
        x[p][r][m][k][j+1] <=
      sum(p in plant,r in request,m in deliveries)
        x[p][r][m][k][j] ;

但是你宁愿写

ct3 : forall (k in truck,j in jobs)
      sum(p in plant,r in request,m in deliveries:(j+1) in jobs)
        x[p][r][m][k][j+1] <=
      sum(p in plant,r in request,m in deliveries)
        x[p][r][m][k][j] ;

致谢