Sets problem

Dear all GAMS users.

I have two indices that are dependent. for example i and j.

if j =1 then i = 1,2;
if j = 2 then i = 1,2,3,4,5, and etc.

how can I code this condition in GAMS

thank you in advance.

\

Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Set i/15/
j/1
2/;
Table task(J,i)
1 2 3 4 5
1 1 1 0 0 0
2 1 1 1 1 1 ;
everywhere you use index j and i, you must set $(Task(j,i)0). for example:
positive variable Par(J,i);
equations Equ(J);

equ(j)… sum(i$(Task(j,i)0),Par(j,i))=E=10;
Is it helpfull?

On Fri, Aug 19, 2011 at 5:37 PM, Babak Saleck Pay wrote:

Dear all GAMS users.

I have two indices that are dependent. for example i and j.

if j =1 then i = 1,2;
if j = 2 then i = 1,2,3,4,5, and etc.

how can I code this condition in GAMS

thank you in advance.

\

Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Thank you ali.


On Fri, Aug 19, 2011 at 6:51 PM, ali wrote:

Set i/15/
j/1
2/;
Table task(J,i)
1 2 3 4 5
1 1 1 0 0 0
2 1 1 1 1 1 ;
everywhere you use index j and i, you must set $(Task(j,i)0). for example:
positive variable Par(J,i);
equations Equ(J);

equ(j)… sum(i$(Task(j,i)0),Par(j,i))=E=10;
Is it helpfull?

On Fri, Aug 19, 2011 at 5:37 PM, Babak Saleck Pay wrote:

Dear all GAMS users.

I have two indices that are dependent. for example i and j.

if j =1 then i = 1,2;
if j = 2 then i = 1,2,3,4,5, and etc.

how can I code this condition in GAMS

thank you in advance.

\

Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.