Whole sets

Top  Previous  Next

GAMS ordinarily operates over every element in a set.  Thus, the command (sets.gms)

 

Set II /i1*i4000/;

Parameter x(ii);

x(ii)=4;

 

will define every case of x associated with the set II to 4 and in this case 4000 of them.

Similarly the definition

 

X(ii)=y(ii) +3;

 

Will sequentially define every case of x in II to equal the associated case in y plus 3;

Also the following commands will each operate or define items for each case of II

 

Loop(II, z=z+y(Ii));

Z=sum(II,y(Ii));

Variable zz(Ii);

Equation eq(Ii);