help with emp needed!

Hello,

I am a graduate student from belgium and I am trying to solve a
bilevel optimization problem using emp.

I get the following error:

**** ERRORS/WARNINGS IN VARIABLE objin1
1 error(s): BILEVEL: follower obj has no entry in follower
equations

I am a beginner in gams and totally new with emp. This is probably a
very simple mistake but I am at a loss.

What could this mean? what should I look out for?


I have included the code here:

$ A leader-followers game with a cournot game for the followers

$ontext

I am trying to solve the following problem:

maximize{q} E q (sum of the cost of the followers) % maximize the
expected value of system cost based on a set of probabilities q
defined with the constraints


s.t sum of q = 1
-q(S)+pbase(S)/(1-alpha) =G= 0




$offtext

set player /p1p2/
S /s1
s4/
;

parameter I(player) /p1 10, p2 15/

parameter A /100/

parameter B/60/

parameter pbase(S) /s1 0.25, s2 0.25, s3 0.25, s4 0.25/

parameter alpha /0.5/

table c(S,player)
p1 p2
s1 2 3
s2 3 2
s3 4 5
s4 1 1

;



variables systcost(S)
ytot(S)
price(S)
objout
objin1
objin2

;



positive variables x(player)
y(player,S)
q(S)

;


equations defout

defsystcost(S)
defytot(S)
defprice(S)
constraintq(S)
sumone

defin1
constraint1(S)

defin2
constraint2(S)



;

defout… objout =E= sum(S,q(S)*systcost(S)) ;

defsystcost(S)… systcost(S) =E=
sum(player,c(S,player)*y(player,S))-price(S)*ytot(S);

defytot(S)… ytot(S)=E=sum(player,y(player,S));

defprice(S)… price(S) =E= A-B*ytot(S);

sumone… sum(S,q(S)) =E= 1;

constraintq(S)… -q(S)+pbase(S)/(1-alpha) =G= 0;




defin1… objin1 =E= I(“p1”)x(“p1”)+ sum(S,q(S)(-
price(S)*y(“p1”,S)+c(S,“p1”)*y(“p1”,S)));

constraint1(S)… x(“p1”) =G= y(“p1”,S);


defin2… objin2 =E= I(“p2”)x(“p2”)+ sum(S,q(S)(-
price(S)*y(“p2”,S)+c(S,“p2”)*y(“p2”,S)));

constraint2(S)… x(“p2”) =G= y(“p2”,S);


model endorisk / all /;

$onecho > “%emp.info%”
bilevel q
min objin1 x(“p1”) y(“p1”,S) defin1 constraint1(S)
min objin2 x(“p2”) y(“p2”,S) defin2 constraint2(S)
$offecho



solve endorisk us emp min objout;


\

problem solved

On Feb 6, 7:21 pm, yann buydens wrote:

Hello,

I am a graduate student from belgium and I am trying to solve a
bilevel optimization problem using emp.

I get the following error:

**** ERRORS/WARNINGS IN VARIABLE objin1
1 error(s): BILEVEL: follower obj has no entry in follower
equations

I am a beginner in gams and totally new with emp. This is probably a
very simple mistake but I am at a loss.

What could this mean? what should I look out for?

I have included the code here:

$ A leader-followers game with a cournot game for the followers

$ontext

I am trying to solve the following problem:

maximize{q} E q (sum of the cost of the followers) % maximize the
expected value of system cost based on a set of probabilities q
defined with the constraints

s.t sum of q = 1
-q(S)+pbase(S)/(1-alpha) =G= 0

$offtext

set player /p1p2/
S /s1
s4/
;

parameter I(player) /p1 10, p2 15/

parameter A /100/

parameter B/60/

parameter pbase(S) /s1 0.25, s2 0.25, s3 0.25, s4 0.25/

parameter alpha /0.5/

table c(S,player)
p1 p2
s1 2 3
s2 3 2
s3 4 5
s4 1 1

;

variables systcost(S)
ytot(S)
price(S)
objout
objin1
objin2

;

positive variables x(player)
y(player,S)
q(S)

;

equations defout

             defsystcost(S)
             defytot(S)
             defprice(S)
             constraintq(S)
             sumone

             defin1
             constraint1(S)

             defin2
             constraint2(S)

;

defout… objout =E= sum(S,q(S)*systcost(S)) ;

defsystcost(S)… systcost(S) =E=
sum(player,c(S,player)*y(player,S))-price(S)*ytot(S);

defytot(S)… ytot(S)=E=sum(player,y(player,S));

defprice(S)… price(S) =E= A-B*ytot(S);

sumone… sum(S,q(S)) =E= 1;

constraintq(S)… -q(S)+pbase(S)/(1-alpha) =G= 0;

defin1… objin1 =E= I(“p1”)x(“p1”)+ sum(S,q(S)(-
price(S)*y(“p1”,S)+c(S,“p1”)*y(“p1”,S)));

constraint1(S)… x(“p1”) =G= y(“p1”,S);

defin2… objin2 =E= I(“p2”)x(“p2”)+ sum(S,q(S)(-
price(S)*y(“p2”,S)+c(S,“p2”)*y(“p2”,S)));

constraint2(S)… x(“p2”) =G= y(“p2”,S);

model endorisk / all /;

$onecho > “%emp.info%”
bilevel q
min objin1 x(“p1”) y(“p1”,S) defin1 constraint1(S)
min objin2 x(“p2”) y(“p2”,S) defin2 constraint2(S)
$offecho

solve endorisk us emp min objout;

\

Hi,
I tried to solve your model, problem is as below:
EMP syntax error: key expected: is y (item 4 on line 2) but instance not in var
iable rim
— EMP Summary (errors=2)
Adjusted Constraint = 0
Flipped Constraints = 0
Dual Variable Maps = 0
Dual Equation Maps = 0
VI Functions = 0
Equilibrium Agent = 0
Bilevel Followers = 1
Disjunctions = 0
Logical Constraints = 0


*** JAMS Pre processing failed


**** ERRORS/WARNINGS IN VARIABLE objin1
1 error(s): BILEVEL: follower obj has no entry in follower equations

Could you tell me how to solve it?







At 2012-02-08 17:49:01,“yann buydens” wrote:

problem solved

On Feb 6, 7:21 pm, yann buydens wrote:

Hello,

I am a graduate student from belgium and I am trying to solve a
bilevel optimization problem using emp.

I get the following error:

**** ERRORS/WARNINGS IN VARIABLE objin1
1 error(s): BILEVEL: follower obj has no entry in follower
equations

I am a beginner in gams and totally new with emp. This is probably a
very simple mistake but I am at a loss.

What could this mean? what should I look out for?

I have included the code here:

$ A leader-followers game with a cournot game for the followers

$ontext

I am trying to solve the following problem:

maximize{q} E q (sum of the cost of the followers) % maximize the
expected value of system cost based on a set of probabilities q
defined with the constraints

s.t sum of q = 1
-q(S)+pbase(S)/(1-alpha) =G= 0

$offtext

set player /p1p2/
S /s1
s4/
;

parameter I(player) /p1 10, p2 15/

parameter A /100/

parameter B/60/

parameter pbase(S) /s1 0.25, s2 0.25, s3 0.25, s4 0.25/

parameter alpha /0.5/

table c(S,player)
p1 p2
s1 2 3
s2 3 2
s3 4 5
s4 1 1

;

variables systcost(S)
ytot(S)
price(S)
objout
objin1
objin2

;

positive variables x(player)
y(player,S)
q(S)

;

equations defout

             defsystcost(S)
             defytot(S)
             defprice(S)
             constraintq(S)
             sumone

             defin1
             constraint1(S)

             defin2
             constraint2(S)

;

defout… objout =E= sum(S,q(S)*systcost(S)) ;

defsystcost(S)… systcost(S) =E=
sum(player,c(S,player)*y(player,S))-price(S)*ytot(S);

defytot(S)… ytot(S)=E=sum(player,y(player,S));

defprice(S)… price(S) =E= A-B*ytot(S);

sumone… sum(S,q(S)) =E= 1;

constraintq(S)… -q(S)+pbase(S)/(1-alpha) =G= 0;

defin1… objin1 =E= I(“p1”)x(“p1”)+ sum(S,q(S)(-
price(S)*y(“p1”,S)+c(S,“p1”)*y(“p1”,S)));

constraint1(S)… x(“p1”) =G= y(“p1”,S);

defin2… objin2 =E= I(“p2”)x(“p2”)+ sum(S,q(S)(-
price(S)*y(“p2”,S)+c(S,“p2”)*y(“p2”,S)));

constraint2(S)… x(“p2”) =G= y(“p2”,S);

model endorisk / all /;

$onecho > “%emp.info%”
bilevel q
min objin1 x(“p1”) y(“p1”,S) defin1 constraint1(S)
min objin2 x(“p2”) y(“p2”,S) defin2 constraint2(S)
$offecho

solve endorisk us emp min objout;


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en. >




To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

I just started over again with the problem in the emplibrary BARD721.
I think its because I used x(“p1”) etcetera. emp doesn’t seem to like
that. I defined x1 instead of a vector x.

On 11 feb, 02:17, 胡辉 wrote:

Hi,
I tried to solve your model, problem is as below:
EMP syntax error: key expected: is y (item 4 on line 2) but instance not in var
iable rim
— EMP Summary (errors=2)
Adjusted Constraint = 0
Flipped Constraints = 0
Dual Variable Maps = 0
Dual Equation Maps = 0
VI Functions = 0
Equilibrium Agent = 0
Bilevel Followers = 1
Disjunctions = 0
Logical Constraints = 0


*** JAMS Pre processing failed


**** ERRORS/WARNINGS IN VARIABLE objin1
1 error(s): BILEVEL: follower obj has no entry in follower equations

Could you tell me how to solve it?

At 2012-02-08 17:49:01,“yann buydens” wrote:

problem solved

On Feb 6, 7:21 pm, yann buydens wrote:

Hello,

I am a graduate student from belgium and I am trying to solve a
bilevel optimization problem using emp.

I get the following error:

**** ERRORS/WARNINGS IN VARIABLE objin1
1 error(s): BILEVEL: follower obj has no entry in follower
equations

I am a beginner in gams and totally new with emp. This is probably a
very simple mistake but I am at a loss.

What could this mean? what should I look out for?

I have included the code here:

$ A leader-followers game with a cournot game for the followers

$ontext

I am trying to solve the following problem:

maximize{q} E q (sum of the cost of the followers) % maximize the
expected value of system cost based on a set of probabilities q
defined with the constraints

s.t sum of q = 1
-q(S)+pbase(S)/(1-alpha) =G= 0

$offtext

set player /p1p2/
S /s1
s4/
;

parameter I(player) /p1 10, p2 15/

parameter A /100/

parameter B/60/

parameter pbase(S) /s1 0.25, s2 0.25, s3 0.25, s4 0.25/

parameter alpha /0.5/

table c(S,player)
p1 p2
s1 2 3
s2 3 2
s3 4 5
s4 1 1

;

variables systcost(S)
ytot(S)
price(S)
objout
objin1
objin2

;

positive variables x(player)
y(player,S)
q(S)

;

equations defout

             defsystcost(S)
             defytot(S)
             defprice(S)
             constraintq(S)
             sumone
             defin1
             constraint1(S)
             defin2
             constraint2(S)

;

defout… objout =E= sum(S,q(S)*systcost(S)) ;

defsystcost(S)… systcost(S) =E=
sum(player,c(S,player)*y(player,S))-price(S)*ytot(S);

defytot(S)… ytot(S)=E=sum(player,y(player,S));

defprice(S)… price(S) =E= A-B*ytot(S);

sumone… sum(S,q(S)) =E= 1;

constraintq(S)… -q(S)+pbase(S)/(1-alpha) =G= 0;

defin1… objin1 =E= I(“p1”)x(“p1”)+ sum(S,q(S)(-
price(S)*y(“p1”,S)+c(S,“p1”)*y(“p1”,S)));

constraint1(S)… x(“p1”) =G= y(“p1”,S);

defin2… objin2 =E= I(“p2”)x(“p2”)+ sum(S,q(S)(-
price(S)*y(“p2”,S)+c(S,“p2”)*y(“p2”,S)));

constraint2(S)… x(“p2”) =G= y(“p2”,S);

model endorisk / all /;

$onecho > “%emp.info%”
bilevel q
min objin1 x(“p1”) y(“p1”,S) defin1 constraint1(S)
min objin2 x(“p2”) y(“p2”,S) defin2 constraint2(S)
$offecho

solve endorisk us emp min objout;


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/gamsworld?hl=en.

\