0
votes

In my data input file, there is the parameter Input[j][n][a][b][c][d][e][f][g][h][i][k] for all values of j,n,a,b,c,d,e,f,g,h,i,k.

My model calculates some boolean decision variables (from dv1 to dv10) (objective is to minimize costs). And then, I need to calculate Value[j][n], which equals the corresponding value in input depending on the decision variables. But the error is 'Indexing array "Input" with type dvar boolean not supported by this algorithm'

Thus I want to do the following:

forall(j in J, n in N) {
    Value[j][n] == Input[j][n][dv1][dv2][dv3][dv4][dv5][dv6][dv7][dv8][dv9][dv10][dv11][dv12];
}

How can you calculate this in CPLEX? Thanks in advance!

2

2 Answers

1
votes

You could also have a look at

https://www.ibm.com/developerworks/community/forums/html/topic?id=2be2ec22-db4b-4a2c-b164-615b9f735dc9&ps=25

where you could read

range r=1..5;

float value[r]=[2,3,4.5,1,0];
dvar int i in 1..5;

maximize sum(k in r) value[k]*(k==i);
subject to
{

}

execute
{
writeln("i=",i);
}
0
votes

if you want to use a decision variable as an index you could try to use Constraint Programming.

In OPL, simply write

using CP;

top of your model

regards