Declare dynamically a static set ?

Hi, I have a problem where I want to declare a static set, but I do not know initially the size of it, its size will be calculated by gams.
So I would like to do something like that:

*-------------------------
parameter x;

x=3*4;

set i /1*x/ ;
*------------------------

I should notice that I do not use the set before the calculation of its size. Also dynamic sets cannot help, because firstly I need the lag operators and secondly I need to declare variables with the size of that set (so I do not want them to become huge for no reason). Finally the calculations needed to come up with the size of the set, are quite complicated, so $eval cannot help me.

Any ideas?

Nick


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

I have the same problem. I want to calculate a scalar and then form a set with a length that depends on the calculated scalar. how should I do that?

در چهارشنبه 2 ژوئیهٔ 2014، ساعت 10:42:07 (UTC+4:30)، NickL نوشته:

Hi, I have a problem where I want to declare a static set, but I do not know initially the size of it, its size will be calculated by gams.
So I would like to do something like that:

*-------------------------
parameter x;

x=3*4;

set i /1*x/ ;
*------------------------

I should notice that I do not use the set before the calculation of its size. Also dynamic sets cannot help, because firstly I need the lag operators and secondly I need to declare variables with the size of that set (so I do not want them to become huge for no reason). Finally the calculations needed to come up with the size of the set, are quite complicated, so $eval cannot help me.

Any ideas?

Nick


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.