Originally posted by: AndyHam
Dear IBM,
I am trying to extract a value from tuple and use it to decide a SIZE of interval variable. But I have an error in the following code.
dvar interval itvJob[a in A][b in B] size D.get(a.l, b.l).d; //syntax error, unexpected '(', expecting ';'
Can you please see if what I have done wrong?
using CP;
tuple t_D {key int f; key int t; int d; }
{t_D} D= { <10, 11, 6>, <10, 12, 4>, <11, 10, 2>, <11, 12, 2>, <12, 10, 3>, <12, 11, 7>};
tuple t_A {
key int id;
int l;
} {t_A} A = { <1, 10>, <2, 11> };
tuple t_B {
key int id;
int l;
} {t_B} B = { <1, 12>, <2, 13> };
execute {
writeln(D.get(10,12).d);
}
dvar interval itvJob[a in A][b in B] size D.get(a.l, b.l).d;
Thanks,
Andy
#DecisionOptimization#OPLusingCPOptimizer