selkie06.gms : SELKIE test suite

Description

A potential Nash game example described in Section 3.1 of the following paper:

Francisco Facchinei, Veronica Piccialli, and Marco Sciandrone:
Decomposition algorithms for generalized potential games,
Computational Optimization and Applications, Vol 50, Issue 2, pp 237--262

Contributor: Youngdae Kim (05.30.2017)


Small Model of Type : GAMS


Category : GAMS Test library


Main file : selkie06.gms

$title 'SELKIE test suite'  (SELKIE06,SEQ=762)

$ontext

A potential Nash game example described in Section 3.1 of the following paper:

Francisco Facchinei, Veronica Piccialli, and Marco Sciandrone:
Decomposition algorithms for generalized potential games,
Computational Optimization and Applications, Vol 50, Issue 2, pp 237--262

Contributor: Youngdae Kim (05.30.2017)

$offtext

$if not set TESTTOL $set TESTTOL 1e-4
scalar tol / %TESTTOL% /;
file opt   / 'selkie.opt' /;
file info  / '%emp.info%' /;

sets i / 1*3 /;

variables obj(i), x(i);
equation defobj(i);

defobj(i)..
    obj(i) =e= -x('1')*x('2') - x('2')*x('3') - x('1')*x('3')
    + sqr(max(0,x('1')-1)) + sqr(max(0,-x('1')-1))
    + sqr(max(0,x('2')-1)) + sqr(max(0,-x('2')-1))
    + sqr(max(0,x('3')-1)) + sqr(max(0,-x('3')-1));

model m / defobj /;

put info 'equilibrium' /;
loop(i,
    put 'min', 'dnlp', obj(i), x(i), defobj(i) /;
);
putclose;

x.lo(i) = -10;
x.up(i) = 10;

scalar epsilon / 1 /;

x.l('1') = -1 - epsilon;
x.l('2') =  1 + 0.5*epsilon;
x.l('3') = -1 - 0.25*epsilon;

option emp = selkie;

solve m using emp;
abort$[ smax{i, abs(abs(x.l(i)) - 10)} > tol ] 'bad x.l(i)', x.l;

$onecho > agent1_gms

Variables  x1,x4,x5,x6;

Equations  e1;

e1.. -(-x4*x5 - x5*x6 - x4*x6 + sqr(max(eps,(-1) + x4)) + sqr(max(eps,(-1) - x4
     )) + sqr(max(eps,(-1) + x5)) + sqr(max(eps,(-1) - x5)) + sqr(max(eps,(-1)
      + x6)) + sqr(max(eps,(-1) - x6))) + x1 =E= 0;

* set non-default bounds
x4.lo = -10; x4.up = 10;

* set non-default levels and fix prox terms
x4.l = -2;

* fix levels belonging to other agents
x5.fx = 1.5;
x6.fx = -1.25;

Model m / e1 /;

Solve m using dnlp minimizing x1;

$offecho

execute 'cat agent1_gms > agent1.gms.want';
execute 'cat "%gams.scrdir%agent1.gms" > agent1.gms.got';
execute '=diff -bw agent1.gms.want agent1.gms.got';
abort$errorlevel 'Files agent1.gms.want and agent1.gms.got differ';

$onecho > agent2_gms

Variables  x2,x4,x5,x6;

Equations  e2;

e2.. -(-x4*x5 - x5*x6 - x4*x6 + sqr(max(eps,(-1) + x4)) + sqr(max(eps,(-1) - x4
     )) + sqr(max(eps,(-1) + x5)) + sqr(max(eps,(-1) - x5)) + sqr(max(eps,(-1)
      + x6)) + sqr(max(eps,(-1) - x6))) + x2 =E= 0;

* set non-default bounds
x5.lo = -10; x5.up = 10;

* set non-default levels and fix prox terms
x5.l = 1.5;

* fix levels belonging to other agents
x4.fx = -2;
x6.fx = -1.25;

Model m / e2 /;

Solve m using dnlp minimizing x2;

$offecho

execute 'cat agent2_gms > agent2.gms.want';
execute 'cat "%gams.scrdir%agent2.gms" > agent2.gms.got';
execute '=diff -bw agent2.gms.want agent2.gms.got';
abort$errorlevel 'Files agent2.gms.want and agent2.gms.got differ';

$onecho > agent3_gms

Variables  x3,x4,x5,x6;

Equations  e3;

e3.. -(-x4*x5 - x5*x6 - x4*x6 + sqr(max(eps,(-1) + x4)) + sqr(max(eps,(-1) - x4
     )) + sqr(max(eps,(-1) + x5)) + sqr(max(eps,(-1) - x5)) + sqr(max(eps,(-1)
      + x6)) + sqr(max(eps,(-1) - x6))) + x3 =E= 0;

* set non-default bounds
x6.lo = -10; x6.up = 10;

* set non-default levels and fix prox terms
x6.l = -1.25;

* fix levels belonging to other agents
x4.fx = -2;
x5.fx = 1.5;

Model m / e3 /;

Solve m using dnlp minimizing x3;

$offecho

execute 'cat agent3_gms > agent3.gms.want';
execute 'cat "%gams.scrdir%agent3.gms" > agent3.gms.got';
execute '=diff -bw agent3.gms.want agent3.gms.got';
abort$errorlevel 'Files agent3.gms.want and agent3.gms.got differ';

* Solve it again with proximal term.

defobj.l(i) = 0;
defobj.m(i) = 0;
obj.l(i) = 0;
x.m(i) = 0;

x.l('1') = -1 - epsilon;
x.l('2') =  1 + 0.5*epsilon;
x.l('3') = -1 - 0.25*epsilon;

putclose opt
   'proximal_use                 {{1..3}}'  /
   'proximal_perturbation_primal 0.5';
m.optfile = 1;

solve m using emp;
abort$[ smax{i, abs(abs(x.l(i)) - 10)} > tol ] 'bad x.l(i)', x.l;

$onecho > agent1prox_gms

Variables  x1,x4,x5,x6,x7,x4_l;

Equations  e1;

e1.. -(-x4*x5 - x5*x6 - x4*x6 + sqr(max(eps,(-1) + x4)) + sqr(max(eps,(-1) - x4
     )) + sqr(max(eps,(-1) + x5)) + sqr(max(eps,(-1) - x5)) + sqr(max(eps,(-1)
      + x6)) + sqr(max(eps,(-1) - x6))) + x1 - x7*(sqr(x4 - x4_l)) =E= 0;

* set non-default bounds
x4.lo = -10; x4.up = 10;

* set non-default levels and fix prox terms
x4.l = -2;
x4_l.fx = -2;
x7.fx = 0.5;

* fix levels belonging to other agents
x5.fx = 1.5;
x6.fx = -1.25;

Model m / e1 /;

Solve m using dnlp minimizing x1;

$offecho

execute 'cat agent1prox_gms > agent1prox.gms.want';
execute 'cat "%gams.scrdir%agent1.gms" > agent1prox.gms.got';
execute '=diff -bw agent1prox.gms.want agent1prox.gms.got';
abort$errorlevel 'Files agent1prox.gms.want and agent1prox.gms.got differ';

$onecho > agent2prox_gms

Variables  x2,x4,x5,x6,x7,x5_l;

Equations  e2;

e2.. -(-x4*x5 - x5*x6 - x4*x6 + sqr(max(eps,(-1) + x4)) + sqr(max(eps,(-1) - x4
     )) + sqr(max(eps,(-1) + x5)) + sqr(max(eps,(-1) - x5)) + sqr(max(eps,(-1)
      + x6)) + sqr(max(eps,(-1) - x6))) + x2 - x7*(sqr(x5 - x5_l)) =E= 0;

* set non-default bounds
x5.lo = -10; x5.up = 10;

* set non-default levels and fix prox terms
x5.l = 1.5;
x5_l.fx = 1.5;
x7.fx = 0.5;

* fix levels belonging to other agents
x4.fx = -2;
x6.fx = -1.25;

Model m / e2 /;

Solve m using dnlp minimizing x2;

$offecho

execute 'cat agent2prox_gms > agent2prox.gms.want';
execute 'cat "%gams.scrdir%agent2.gms" > agent2prox.gms.got';
execute '=diff -bw agent2prox.gms.want agent2prox.gms.got';
abort$errorlevel 'Files agent2prox.gms.want and agent2prox.gms.got differ';

$onecho > agent3prox_gms

Variables  x3,x4,x5,x6,x7,x6_l;

Equations  e3;

e3.. -(-x4*x5 - x5*x6 - x4*x6 + sqr(max(eps,(-1) + x4)) + sqr(max(eps,(-1) - x4
     )) + sqr(max(eps,(-1) + x5)) + sqr(max(eps,(-1) - x5)) + sqr(max(eps,(-1)
      + x6)) + sqr(max(eps,(-1) - x6))) + x3 - x7*(sqr(x6 - x6_l)) =E= 0;

* set non-default bounds
x6.lo = -10; x6.up = 10;

* set non-default levels and fix prox terms
x6.l = -1.25;
x6_l.fx = -1.25;
x7.fx = 0.5;

* fix levels belonging to other agents
x4.fx = -2;
x5.fx = 1.5;

Model m / e3 /;

Solve m using dnlp minimizing x3;

$offecho

execute 'cat agent3prox_gms > agent3prox.gms.want';
execute 'cat "%gams.scrdir%agent3.gms" > agent3prox.gms.got';
execute '=diff -bw agent3prox.gms.want agent3prox.gms.got';
abort$errorlevel 'Files agent3prox.gms.want and agent3prox.gms.got differ';

* Test the model without writing agent's problem into a file.
putclose opt
   'write_agent_model          no';
m.optfile = 1;

obj.l(i) = 0;
x.l('1') = -1 - epsilon;
x.l('2') =  1 + 0.5*epsilon;
x.l('3') = -1 - 0.25*epsilon;

solve m using emp;
abort$[ smax{i, abs(abs(x.l(i)) - 10)} > tol ] 'bad x.l(i)', x.l;