I try to create a set of decision variables which is not using the integer values from the for-Loop but instead gets the value from an array.
The reason is that I want the indices to be the same like the numbers in the arrays. The numbering of Array could look like:
int [] Array = {12,11,10,15,16,17};
I get a arrayoutofboundsexception error when I run it.
Here the part of the code:
x = new IloNumVar[inputData.Array().length][inputData.Array().length][inputData.Arraytwo().length];
for (int i=0; i< inputData.Array().length;i++){
this.x[inputData.Array()[i]]= new IloNumVar[inputData.Array().length][];
for (int j=0; j< inputData.Array().length;j++){
this.x[inputData.Array()[[i][j] = new IloNumVar[inputData.Arraytwo().length];
for (int k=0; k<inputData.get_sub_K_set().length;k++){
this.xx[inputData.Array()[i]][inputData.Array()[j]][inputData.Arraytwo()[k]]= this.boolVar("x:i_"+inputData.Array()[i]+"-j_"+inputData.Array()[j]+"-k_"+inputData.Arraytwo()[k]);
}
}
}
I appreciate any help. Thank you guys!