Hi GAMS world,
I have a problem here. There are binary variables x(j), among which only two variables equal to 1, and others are 0, for example x(‘1’) to x(‘7’) they equal to 0, 0, 1, 0, 0, 1, 0, respectively. The variables equal to 1 can be located in on the rightmost or leftmost or adjacently.
Is it possible to use linear equations to make variables y(j), among which variables equal to 1 when the number of their index are between or equal to those variable x(j) equal to 1. For example y(‘1’) to y('7) they equal to 0, 0, 1, 1, 1, 1, 0, respectively when x(‘1’) to x(‘7’) they equal to 0, 0, 1, 0, 0, 1, 0, respectively.
Thank you,
Dylan
–
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.
I’ve found the solution, thanks.
在 2013å¹´9月2日星期一UTC+8下åˆ8æ—¶00分10秒,Dylan Lan写é“:
Hi GAMS world,
I have a problem here. There are binary variables x(j), among which only two variables equal to 1, and others are 0, for example x(‘1’) to x(‘7’) they equal to 0, 0, 1, 0, 0, 1, 0, respectively. The variables equal to 1 can be located in on the rightmost or leftmost or adjacently.
Is it possible to use linear equations to make variables y(j), among which variables equal to 1 when the number of their index are between or equal to those variable x(j) equal to 1. For example y(‘1’) to y('7) they equal to 0, 0, 1, 1, 1, 1, 0, respectively when x(‘1’) to x(‘7’) they equal to 0, 0, 1, 0, 0, 1, 0, respectively.
Thank you,
Dylan
–
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.