Cplex Studio Does not support dvar float

自作多情 提交于 2020-02-06 07:57:11

问题


I am trying to use a variable to record the local timings of an object. As I could not find any way to define a variable in the Cplex, I tried using "dvar float" to define the variable. But, Cplex says that the algorithm does not support "dvar float". I tried simply define the variable as float Z[i][r][k] and also tried using CP, both did not solve the issue. May I have some help or guidance please?

i = 0..3;
r = 0..1;
j = 0..3;
s = 0..1;
k = 1; 
float U[1..3][1..1] = ...;
float T[i][r][j][s] = ...;
float M[1..3][1..1] = ...; 
dvar boolean X[i][r][j][s][k];
dvar boolean Y[1..N][1..H][k];
dvar float Z[i][r][k];

forall(ci in i:ci!=0, cr in r:cr!=0, cj in j, cs in s: (ci!=cj)||(cr!=cs), ck in k)
  TimeRecord1: 
    Z[cj][cs][ck] == X[ci][cr][cj][cs][ck] * (T[ci][cr][cj][cs] + (U[ci][cr] + (M[ci][cr] - Z[ci][cr][ck])) * Y[ci][cr][ck]);

回答1:


with CP, float decision variables are not allowed. What you can do is use a variable change to model decimal decision variables. You have an example in

CPLEX_Studio1210\opl\examples\opl\floatexpr

See also CPLEX OPL using decision variable as float in constraint programming algorithm

within stackoverflow



来源:https://stackoverflow.com/questions/59766834/cplex-studio-does-not-support-dvar-float

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!