sequential set s = {1, 2, 3, ..., N} bounded by parameter N

25 views
Skip to first unread message

joanna

unread,
May 30, 2012, 5:21:58 AM5/30/12
to gamsworld
Hi,

I am wondering whether it is possible to define a sequential set s =
{1, 2, 3, ..., N} depending on an upper parameter N? In other words,
how do I formulate the naive

parameter N;
set s /1*N/;

so that gams understands it?

Joanna

Destin Zed

unread,
May 30, 2012, 11:13:16 AM5/30/12
to gams...@googlegroups.com
Hi,

You may use the following

$IF NOT SET N $SET N 'Default'

*Note replace 'Default' with an integer

PARAMETER N
/YourPreferredNumber/
;
SET s /1*%N%/;

This should work for you.

Destin




  Joanna

--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


Reply all
Reply to author
Forward
0 new messages