I have a question and i would be appreciate if you can help me:
assume that I have 30 different sets in my model but I am not gonna use all of them. Depend on the value of one of the variables some of the sets must be use in constraints. I decided to use if-elseif+alias to solve my problem, but I dont know is that correct or which part of the program shall I write this code:
sets
g1 /1/
g2 /2/
g3 /3/
g4 /4/
g5 /5/
g6 /6/
g7 /7/
g8 /8/
g9 /9/
g10 /10/;
if (y1=1 and y2=1 and y3=1,
alias(g1,L1) and alias(g2,L2);
Elseif y1=1 and y2=1 and y4=1,
alias(g1,L1) and alias(g3,L2);
Elseif y1=1 and y4=1and y5=1,
alias(g3,L1) and alias(g6,L2));
Equation
const1(i)
const2(i);
const1(i)$L1… v(i)=g=epsilon;
const2(i)$L2… v(i)=g=0;
the If-elseif is longer than what I wrote and also i have much more constraints, I just wanna know this form of writing is correct?
I am new in gams and this is the first code I am going to write.
Thanks is advance.
–
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.