using one variable name with two types

I would like to use only one variable (y) but let it to take integer and positive values for different index values as follows:

Sets
t /140/
pt(t) /1
10/
it(t) /11*40/;

Positive variable
y(pt);

Binary variable
y(it);

Is there a way to do this without defining two separate variables (i.e. y1 and y2)?

Thanks so much…


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.

Dilek,

Have a look at the model LRS in the GAMS model library: it explains how to use priorities to do what you ask about.

-Steve

On Mon, Aug 31, 2015 at 9:44 AM, wrote:

I would like to use only one variable (y) but let it to take integer and positive values for different index values as follows:

Sets
t /140/
pt(t) /1
10/
it(t) /11*40/;

Positive variable
y(pt);

Binary variable
y(it);

Is there a way to do this without defining two separate variables (i.e. y1 and y2)?

Thanks so much…


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.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com

Thank you very much, Steve. I will check out the LRS model.

31 Ağustos 2015 Pazartesi 17:18:58 UTC+3 tarihinde Steven Dirkse yazdı:

Dilek,

Have a look at the model LRS in the GAMS model library: it explains how to use priorities to do what you ask about.

-Steve

On Mon, Aug 31, 2015 at 9:44 AM, wrote:

I would like to use only one variable (y) but let it to take integer and positive values for different index values as follows:

Sets
t /140/
pt(t) /1
10/
it(t) /11*40/;

Positive variable
y(pt);

Binary variable
y(it);

Is there a way to do this without defining two separate variables (i.e. y1 and y2)?

Thanks so much…


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



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdi...@gams.com
http://www.gams.com


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.