Originally posted by: Rajasekhar Kadambur
Hi,
How to initialize decision variable using tuple? use of tuple is due to unstructured array in 1 dimensionality and decision variable is four dimensions.
Consider this example'
data file:
// A = [ <{3,2,2}>, <{2,4,3}>,<{2,2}>, <{2,4,3}>, <{1}>, <{3,3,3}>, <{2,4,4}>, <{2,2,2}>, <{4,3,4}> ];
Mod file:
int A_var = [[3,3,2],[3,1,3],[3,3,3] ]; // size of unstructured array
tuple 3D{ int a; int b; {int} c; }
{3D} Data = {<a,b,c>| a in 1..3, b in 1..3, c in A_var[a][b]};
dvar boolean X[d in Data][1..60];
I guess X declared is 4 dimension and i am not able to build constraints based on dvar X....
for example, X[1][1][1][1] != X[2][1][1][1] != X[3][1][1][1];
any one should be active not all the three but all three can be 0
similarly, X[1][1][1][1] != X[1][2][1][1] != X[1][3][1][1];
X[1][1][1][1] != X[1][1][2][1] != X[1][1][3][1];
sum across first three dimensions should be <= 1;
Thanks in advance, your advice/ response is highly appreciated
PS: this constrains are not valid but to have a overview i included that.
#DecisionOptimization#OPLusingCPLEXOptimizer