y(x(i)) is a construct unknown to classical mathematical programming (MP). Such constructs works in the context of constraint programming. If you have a constraint programming problem GAMS is not the a good candidate to formulate and solve such problems. If you have an MP problem you can can't use such constructs. There are ways to reformulate y(x(i)) into MP constructs. Let have z(i) = y(x(i)) with i=i1..in and x(i) in {1,2,3,4,5} for all i. Then you can transform the term z(i) = y(x(i)) into regular algebra as follows:
Code: Select all
set i / i1*i10 /, xi /1*5/;
integer variable x(i); binary variable b(i,xi), variable y(xi), z(i);
equation defz(i);
defz(i).. z(i) =e= sum(xi, y(xi)*b(i,xi));
defb(i).. sum(xi, b(i,xi)) =e= 1;
* followed by code that govern the variables x and y
You are left with a quadratic term of a continuous variable (y) and a binary variable (b) that you can linearize to get a MIP (in case the rest of your program is linear). If y is bounded then you can do this with bigM reformulations, otherwise you need SOS1 or indicator constraints. You should find some hints in the forum how to do that.
Good luck,
Michael