Loop for different scenarios (changing ratio)

Dear All,
I am trying to use loop statement for different scenarios. I would like to use different ratios and see how changing the ratio affect the model results.

Here is part of my model. If any one can help me out to find out the way to define the loop statement, I would really appreciate it.
Thank you.

PARAMETERS
alfar(p) percentage of product that can be sent to recycling
;
alfar (p)
/
1 0.1
2 0.2
3 0.3
4 0.4
5 0.5
6 0.6
7 0.7
8 0.9
9 0.9
10 1
11 0
/
Equations
Const3a(IN,c,p,t) at the inspection center component can be sent to recycled center
Const3a(IN,C,p,t)… sum(G,alfar(p)*X1(G,IN,p,t))=g= sum(R,(1/alfapc(p))*X5(IN,R,c,t));
obj…h=e=sum((c,p,IN,R,t), Tpt(t,“INS”)*alfar(p)*X5(IN,R,c,t));
MODEL REVLOG /ALL/;
solve model using MIP minimizing h;


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.

Hello,

this may help

.
.
.
parameter alf(p), resobj(p);

obj…h=e=sum((c,p,IN,R,t), Tpt(t,“INS”)*alf(p)*X5(IN,R,c,t));
MODEL REVLOG /ALL/;

loop(p,
alf(p)=alfar(p);
solve model using MIP minimizing h;

  • Also I would put something to store the objective function per scenario
    resobj(p)=h.l;
    );
    Hope that helps.

Kostas

Τη Δευτέρα, 8 Δεκεμβρίου 2014 5:26:43 μ.μ. UTC, ο χρήστης deniz έγραψε:

Dear All,
I am trying to use loop statement for different scenarios. I would like to use different ratios and see how changing the ratio affect the model results.

Here is part of my model. If any one can help me out to find out the way to define the loop statement, I would really appreciate it.
Thank you.

PARAMETERS
alfar(p) percentage of product that can be sent to recycling
;
alfar (p)
/
1 0.1
2 0.2
3 0.3
4 0.4
5 0.5
6 0.6
7 0.7
8 0.9
9 0.9
10 1
11 0
/
Equations
Const3a(IN,c,p,t) at the inspection center component can be sent to recycled center
Const3a(IN,C,p,t)… sum(G,alfar(p)*X1(G,IN,p,t))=g= sum(R,(1/alfapc(p))*X5(IN,R,c,t));
obj…h=e=sum((c,p,IN,R,t), Tpt(t,“INS”)*alfar(p)*X5(IN,R,c,t));
MODEL REVLOG /ALL/;
solve model using MIP minimizing h;


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.

Hello,

Here is one way of doing it:

parameter log(p,*) ‘record your solution of each ratio’;
PUT YOUR DECLARATION HERE

loop(p,
solve model using MIP minimizing h;
log(p,‘result’)=h;
);
display log;

Sophia

On Monday, December 8, 2014 12:26:43 PM UTC-5, deniz wrote:

Dear All,
I am trying to use loop statement for different scenarios. I would like to use different ratios and see how changing the ratio affect the model results.

Here is part of my model. If any one can help me out to find out the way to define the loop statement, I would really appreciate it.
Thank you.

PARAMETERS
alfar(p) percentage of product that can be sent to recycling
;
alfar (p)
/
1 0.1
2 0.2
3 0.3
4 0.4
5 0.5
6 0.6
7 0.7
8 0.9
9 0.9
10 1
11 0
/
Equations
Const3a(IN,c,p,t) at the inspection center component can be sent to recycled center
Const3a(IN,C,p,t)… sum(G,alfar(p)*X1(G,IN,p,t))=g= sum(R,(1/alfapc(p))*X5(IN,R,c,t));
obj…h=e=sum((c,p,IN,R,t), Tpt(t,“INS”)*alfar(p)*X5(IN,R,c,t));
MODEL REVLOG /ALL/;
solve model using MIP minimizing h;


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.

Thank you very much!
I am going to try and hopefully it will work.
Regards

On Monday, December 8, 2014 11:26:43 AM UTC-6, deniz wrote:

Dear All,
I am trying to use loop statement for different scenarios. I would like to use different ratios and see how changing the ratio affect the model results.

Here is part of my model. If any one can help me out to find out the way to define the loop statement, I would really appreciate it.
Thank you.

PARAMETERS
alfar(p) percentage of product that can be sent to recycling
;
alfar (p)
/
1 0.1
2 0.2
3 0.3
4 0.4
5 0.5
6 0.6
7 0.7
8 0.9
9 0.9
10 1
11 0
/
Equations
Const3a(IN,c,p,t) at the inspection center component can be sent to recycled center
Const3a(IN,C,p,t)… sum(G,alfar(p)*X1(G,IN,p,t))=g= sum(R,(1/alfapc(p))*X5(IN,R,c,t));
obj…h=e=sum((c,p,IN,R,t), Tpt(t,“INS”)*alfar(p)*X5(IN,R,c,t));
MODEL REVLOG /ALL/;
solve model using MIP minimizing h;


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.