Hi,
Let me give you a small example you could improve:
tuple TP
{
key int p;
key int l ;
float Cost;
}
{TP} PL = {
<1 , 1 , 10>,
<1 , 2 , 30>,
<1 , 3 , 40>,
<2 , 1 , 230>,
<2 , 2 , 90>,
<2 , 3 , 130>
};
int L[i in 1..5]=i;
int M[i in 1..5]=10*i;
int H[i in 1..5]=100*i;
dvar float res;
dexpr float X[pl in PL] = (pl.Cost* L[pl.p] + pl.Cost * M[pl.p] + pl.Cost * H[pl.p]) ;
subject to
{
res==X[first(PL)];
}
execute
{
writeln(res);
}
regards
#DecisionOptimization#OPLusingCPLEXOptimizer