0

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]);
liu chao
  • 1
  • 2

1 Answers1

0

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

Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15