need help-parameter value assign effeciently

Dear Gams Friend,
How can we assign the probability of the following in an efficient way not by typing one by one. it is particularly needed if no. of set elements are higher for example 10,000.

In the example below: It has four groups ( each of s1s5 has probability 0.02 , each of s6s10 has probability 0.06, each of s11s15 has probability 0.08, each of s16s20 has probability of 0.04)

Set s /S1*S20/;

parameter p(s) probability of scenario-customized by organization
/S1 0.02
S2 0.02
S3 0.02
S4 0.02
S5 0.02
S6 0.06
S7 0.06
S8 0.06
S9 0.06
S10 0.06
S11 0.08
S12 0.08
S13 0.08
S14 0.08
S15 0.08
S16 0.04
S17 0.04
S18 0.04
S19 0.04
S20 0.04
/;


Display p;

I appreciate your help.
Syed


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/groups/opt_out.

Dear Syed,

You can do:

Set s /S1*S20/;

parameter p(s) probability of scenario-customized by organization;

p(s)$( ORD(s) 5) AND (ORD(s) 10) AND (ORD(s) 15) AND (ORD(s) wrote:

Dear Gams Friend,
How can we assign the probability of the following in an efficient way not by typing one by one. it is particularly needed if no. of set elements are higher for example 10,000.

In the example below: It has four groups ( each of s1s5 has probability 0.02 , each of s6s10 has probability 0.06, each of s11s15 has probability 0.08, each of s16s20 has probability of 0.04)

Set s /S1*S20/;

parameter p(s) probability of scenario-customized by organization
/S1 0.02
S2 0.02
S3 0.02
S4 0.02
S5 0.02
S6 0.06
S7 0.06
S8 0.06
S9 0.06
S10 0.06
S11 0.08
S12 0.08
S13 0.08
S14 0.08
S15 0.08
S16 0.04
S17 0.04
S18 0.04
S19 0.04
S20 0.04
/;


Display p;

I appreciate your help.
Syed


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/groups/opt_out.



\

PEDRO JAVIER RAMÍREZ TORREALBA
Ingeniero Civil Eléctrico PUC
MSc en Ingeniería Eléctrica PUC
Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119


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/groups/opt_out.

Hi,

I think this should work.



Parameter p(s)

/ s1S5 0.02
s6
S10 0.06
s11*S15 0.08
S16 *S20 0.04
/;



Yonas

From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Syed Ali
Sent: 25. oktober 2013 15:01
To: gamsworld@googlegroups.com
Subject: need help-parameter value assign effeciently



Dear Gams Friend,
How can we assign the probability of the following in an efficient way not by typing one by one. it is particularly needed if no. of set elements are higher for example 10,000.

In the example below: It has four groups ( each of s1s5 has probability 0.02 , each of s6s10 has probability 0.06, each of s11s15 has probability 0.08, each of s16s20 has probability of 0.04)

Set s /S1*S20/;

parameter p(s) probability of scenario-customized by organization
/S1 0.02
S2 0.02
S3 0.02
S4 0.02
S5 0.02
S6 0.06
S7 0.06
S8 0.06
S9 0.06
S10 0.06
S11 0.08
S12 0.08
S13 0.08
S14 0.08
S15 0.08
S16 0.04
S17 0.04
S18 0.04
S19 0.04
S20 0.04
/;


Display p;

I appreciate your help.
Syed


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/groups/opt_out.


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/groups/opt_out.

That`s Great Friend! This tricks seem really interesting and user friendly. My gratefulness to all of my GAMS friends.

On Friday, October 25, 2013 10:39:31 PM UTC+9, Yonas Gebrekiros wrote:

Hi,

I think this should work.



Parameter p(s)

/ s1S5 0.02
s6
S10 0.06
s11*S15 0.08
S16 *S20 0.04
/;



Yonas

From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Syed Ali
Sent: 25. oktober 2013 15:01
To: gams...@googlegroups.com
Subject: need help-parameter value assign effeciently



Dear Gams Friend,
How can we assign the probability of the following in an efficient way not by typing one by one. it is particularly needed if no. of set elements are higher for example 10,000.

In the example below: It has four groups ( each of s1s5 has probability 0.02 , each of s6s10 has probability 0.06, each of s11s15 has probability 0.08, each of s16s20 has probability of 0.04)

Set s /S1*S20/;

parameter p(s) probability of scenario-customized by organization
/S1 0.02
S2 0.02
S3 0.02
S4 0.02
S5 0.02
S6 0.06
S7 0.06
S8 0.06
S9 0.06
S10 0.06
S11 0.08
S12 0.08
S13 0.08
S14 0.08
S15 0.08
S16 0.04
S17 0.04
S18 0.04
S19 0.04
S20 0.04
/;


Display p;

I appreciate your help.
Syed


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/groups/opt_out.


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/groups/opt_out.