selkie07.gms : SELKIE test suite

Description

A potential Nash game example described in Section 5 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 : selkie07.gms

$title 'SELKIE test suite'  (SELKIE07,SEQ=763)

$ontext

A potential Nash game example described in Section 5 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%' /;

set i / 1*2 /;

variables obj(i);
positive variables x(i);

equation defobj(i), cons(i);

scalar tau / 1 /;

defobj(i)..
    obj(i) =e=
    (-0.5*tau*sqr(x('1')) + x('1')*x('2'))$(i.val eq 1) +
    (sqr(x('2')) + x('1')*x('2'))$(i.val eq 2);

cons(i)..
    x('2') =l= x('1') + 1;

x.up('1') = 1;

model m / defobj, cons /;

file empinfo / '%emp.info%' /;
put empinfo 'equilibrium' /;
loop(i,
    put 'min', obj(i), x(i), cons(i), defobj(i) /;
);
putclose;

option emp = selkie;

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

$onecho > agent1_gms

Variables  x1,x3,x4;

Positive Variables  x3,x4;

Equations  e1,e3;

e1.. -(x3*x4 - 0.5*sqr(x3)) + x1 =E= 0;

e3..  - x3 + x4 =L= 1;

* set non-default bounds
x3.up = 1;


* fix levels belonging to other agents
x4.fx = 0;

Model m / e1,e3 /;

Solve m using nlp 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,x3,x4;

Positive Variables  x3,x4;

Equations  e2,e4;

e2.. -(sqr(x4) + x3*x4) + x2 =E= 0;

e4..  - x3 + x4 =L= 1;



* fix levels belonging to other agents
x3.fx = 0;

Model m / e2,e4 /;

Solve m using nlp 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';

* 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(i) = 0;
cons.m(i) = 0;

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