multiplayer in Bilevel Programming

Solver related questions
Post Reply
h.davoudy@gmail.com
User
User
Posts: 1
Joined: 6 days ago

multiplayer in Bilevel Programming

Post by h.davoudy@gmail.com » 6 days ago

Hi
I want to use GAMS Bilevel Programming to solve my model but I have a problem. I have a demand from one port (origin) to two ports (destination). I want to maximize the profit of these two destinations and compare the situation of these ports. but I dont know how can I use "index" in my objective functions. this is my first time I have an objective function with index and GAMS shows $121, $409 and &125 errors.
I have these errors in first line ( Ck(Ik(j)) ) and last line ( obj (j) )

Code: Select all

         defout(j)..       Obj(j) =e= (T(j)-C)*q(j)-[Ck(Ik(j))+Cp(Ip(j))+(M(j)*x(j)*exp(Ip(j)/Ik(j))];
         defin(j)..        q(j) =e= Demand*(exp(-V(j))/exp(-sum(j,V(j))));

         Congestion_Cost(j)..           g(j)                   =e= q(j)/IK(j);
         Disaster_Cost(j)..                F(j)                   =e= x(j)* M(j) * exp( IP(j) / IK(j));
         Capacity_Inv(j)..                 Ck(j)                  =e= 0.3 * Ik(j) ;
         Protect_Inv(j)..                   Cp(j)                  =e= 0.2 * Ip(j) ;
         Utility_Func(j)..                   U(j)                   =e= Alpha0+ Alpha1*TT(j)+ Alpha2*T(j)+ Alpha3*g(j)+ Alpha4*F(j)+ epsilon ;
         e1(j)..                                Ik(j)+Ip(j) =l= B ;
         e2(j)..                                V(j) =e= U(j)-epsilon ;
         
         Model bard / all /;
$echo bilevel Ik(j) Ip(j) min q(j) Protect_Inv(j),Capacity_Inv(j), defout(j), defin(j), Congestion_Cost(j), Disaster_Cost(j), Utility_Func(j), e1(j), e2(j) > "%emp.info%"
solve bard use emp max obj(j);

sincerly
Hamed,

User avatar
Renger
Posts: 295
Joined: 2 years ago

Re: multiplayer in Bilevel Programming

Post by Renger » 6 days ago

Hi

Assuming j has two elements port1 and port2, you could write two objective functions and solve the model twice with a different objective function:

Code: Select all

         defout1..       Obj=e= (T("port1")-C)*q("port1")...
         defout2..      Obj=e= (T("port2")-C)*q("port2")...
....

         Model bard1 /defout1, .../;
         Model bard2 /defout2, .../;
$echo bilevel Ik(j) Ip(j) min q(j) Protect_Inv(j),Capacity_Inv(j), defout(j), defin(j), Congestion_Cost(j), Disaster_Cost(j), Utility_Func(j), e1(j), e2(j) > "%emp.info%"
solve bard1 use emp max obj;
solve bard2 use emp max obj;
You could also write the objective constraints as

Code: Select all

defout1.. Obj =E= sum(j$(sameas(j,"port1"), (T(j)-C)*q(j)-[Ck(Ik(j))+Cp(Ip(j))+(M(j)*x(j)*exp(Ip(j)/Ik(j))]);
defout2.. Obj =E= sum(j$(sameas(j,"port2"), (T(j)-C)*q(j)-[Ck(Ik(j))+Cp(Ip(j))+(M(j)*x(j)*exp(Ip(j)/Ik(j))]);
Hope this helps
Renger
____________________________________
Enjoy modeling even more: The lazy economist

Post Reply