Hey guys. I´m a newbie in GAMS and this is my first post.

Recently i did an allocation algorithm for my thesis in GAMS.

The algorithm is working with 20 demands in a frequency comb of 50 “pulses”. We´d like to try it for 200 demands and 500 pulses.

In order to avoid typing all of this, i´d like to simulate an optical frequency comb and continue trying the algorithm.

Before I import the data from Excel, I´d like to try it in GAMS (It should be easy i guess… but i´m missing something). The code seems simple.

The intent of the code is to generate 10 random numbers in ascending order and then, make a mirror of those numbers. So it looks like the image:

The code is here:

GenPeine.gms (301 Bytes)

set i /1*10/;

parameter x(i);

x(‘1’) = uniformint(5, 10);

loop(i$(ord(i) > 1),

x(i) = x(i-1) + uniformint(0,3);

);

display x;

parameter y(i);

y(i)(ord(i) <= card(i)) = x(i);
y(i)((ord(i) > card(i))) = x(2*card(i)-(ord(i)+1));

display y;

The errors are 2 lines after the parameter designation of “y(i)” :

- Set identifier or quoted element expected
- Dimension different - The symbol is referenced with more/less

indices as declared - ‘)’ expected
- Too many ),] or }

Any advise?