jeudi 28 mai 2015

GAMS If-Else If-Else multiple loop conversion to MILP statements

I am working on MILP model of GAMS and want to convert If-Else if-Else loops to MILP statements. The code is as follows:

set I /a b c/;

Parameter1 /

a 1.5

b 1.8

c 2.3 /;

Parameter2/

a 1

b 1

c 2 /;

Parameter3/

a 2

b 2.5

c 3 /;

Parameter4/

a 1.5

b 1

c 2 /;

If Parameter1 < Parameter2

(

If Paramater3 < Parameter2

(Variable 1 = Parameter3;)

Else

(Variable1 = Parameter2;)

)

Else if Parameter1 > Parameter2

(

If Parameter3 < (Parameter1 + 0.75)

(Variable 1 = Parameter3;)

Else

(Variable 1 = Parameter1 + 0.75;)

)

Else if Parameter1 = Parameter2

(

If Parameter3 < (Parameter1 + 0.25)

(Variable 1 = Parameter3;)

Else

(Variable 1 = Parameter1 + 0.25;)

)

Obj..

x =e= sum(I,Variable1*Parameter4);

Kindly guide on how to convert the If-Else loop into GAMS MILP model. Thanks in advance

Aucun commentaire:

Enregistrer un commentaire