Hi dear community,
I have a constraint as sum((k,z1), y(b,k,z1,l,z2)) <= 1 and I want to add if statement to it:
if k = l, then z1 cannot be equal to z2;
if k<>l, then there’s no further constraint for z1 and z2.
I tryed to add it like this:
if k<>l then sum((k,z1), y(b,k,z1,l,z2)) <= 1
if k=l then sum((k,z1)|z1<>z2, y(b,k,z1,l,z2)) <= 1
The AIMMS through out the message “The scope of index "k" has not been specified.” like shown in the screenshot(I’ve highlighted where the error is-the first k appears in if statement).
So my question is, is there a way to fix this constraint in the way that I want it to be? (maybe using element parameter)?
Thanks in advance!
Best answer by Marcel HuntingView original