EPEC solve
Solving Equilibrium Problems with Equilibrium Constraints (EPECs)
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Game::EPEC Class Referenceabstract

Class to handle a Nash game between leaders of Stackelberg games. More...

#include <games.h>

Inheritance diagram for Game::EPEC:
Models::EPEC My_EPEC_Prob

Public Member Functions

 EPEC ()=delete
 
 EPEC (EPEC &)=delete
 
 ~EPEC ()
 
void finalize ()
 Finalizes the creation of a Game::EPEC object. More...
 
void findNashEq ()
 
std::unique_ptr< GRBModel > Respond (const unsigned int i, const arma::vec &x) const
 
double RespondSol (arma::vec &sol, unsigned int player, const arma::vec &x, const arma::vec &prevDev) const
 
bool isSolved (unsigned int *countryNumber, arma::vec *ProfDevn, double tol=51e-4) const
 
bool isSolved (double tol=51e-4) const
 
const arma::vec getx () const
 
void reset ()
 
const arma::vec getz () const
 
const EPECStatistics getStatistics () const
 Get the EPECStatistics object for the current instance. More...
 
void setAlgorithm (Game::EPECalgorithm algorithm)
 
Game::EPECalgorithm getAlgorithm () const
 
void setRecoverStrategy (Game::EPECRecoverStrategy strategy)
 
Game::EPECRecoverStrategy getRecoverStrategy () const
 
void setAggressiveness (unsigned int a)
 
unsigned int getAggressiveness () const
 
void setNumThreads (unsigned int t)
 
unsigned int getNumThreads () const
 
void setAddPolyMethodSeed (unsigned int t)
 
unsigned int getAddPolyMethodSeed () const
 
void setIndicators (bool val)
 
bool getIndicators () const
 
void setPureNE (bool val)
 
bool getPureNE () const
 
void setBoundPrimals (bool val)
 
bool getBoundPrimals () const
 
void setBoundBigM (double val)
 
double getBoundBigM () const
 
void setTimeLimit (double val)
 
double getTimeLimit () const
 
void setAddPolyMethod (Game::EPECAddPolyMethod add)
 
Game::EPECAddPolyMethod getAddPolyMethod () const
 
unsigned int getnVarinEPEC () const noexcept
 
unsigned int getNcountries () const noexcept
 
unsigned int getPosition_LeadFoll (const unsigned int i, const unsigned int j) const
 
unsigned int getPosition_LeadLead (const unsigned int i, const unsigned int j) const
 
unsigned int getPosition_LeadFollPoly (const unsigned int i, const unsigned int j, const unsigned int k) const
 
unsigned int getPosition_LeadLeadPoly (const unsigned int i, const unsigned int j, const unsigned int k) const
 
unsigned int getNPoly_Lead (const unsigned int i) const
 
unsigned int getPosition_Probab (const unsigned int i, const unsigned int k) const
 
double getVal_LeadFoll (const unsigned int i, const unsigned int j) const
 
double getVal_LeadLead (const unsigned int i, const unsigned int j) const
 
double getVal_LeadFollPoly (const unsigned int i, const unsigned int j, const unsigned int k, const double tol=1e-5) const
 
double getVal_LeadLeadPoly (const unsigned int i, const unsigned int j, const unsigned int k, const double tol=1e-5) const
 
double getVal_Probab (const unsigned int i, const unsigned int k) const
 
bool isPureStrategy (const unsigned int i, const double tol=1e-5) const
 
bool isPureStrategy (const double tol=1e-5) const
 
std::vector< unsigned int > mixedStratPoly (const unsigned int i, const double tol=1e-5) const
 
const LCPgetLcpDescr () const
 
const GRBModel & getLcpModel () const
 
void writeLcpModel (std::string filename) const
 

Protected Member Functions

bool warmstart (const arma::vec x)
 Warmstarts EPEC with a solution. More...
 
 EPEC (GRBEnv *env)
 
virtual void make_obj_leader (const unsigned int i, Game::QP_objective &QP_obj)=0
 Can be instantiated by a derived class only! More...
 
virtual void prefinalize ()
 Empty function - optionally reimplementable in derived class. More...
 
virtual void postfinalize ()
 Empty function - optionally reimplementable in derived class. More...
 
virtual void updateLocs ()=0
 
virtual void make_MC_cons (arma::sp_mat &MC, arma::vec &RHS) const
 
bool hasLCP () const
 

Protected Attributes

std::vector< std::shared_ptr< Game::NashGame > > countries_LL {}
 
std::vector< std::unique_ptr< Game::LCP > > countries_LCP {}
 
std::vector< std::shared_ptr< Game::QP_Param > > country_QP {}
 The QP corresponding to each player. More...
 
std::vector< std::shared_ptr< Game::QP_objective > > LeadObjec {}
 Objective of each leader. More...
 
std::vector< std::shared_ptr< Game::QP_objective > > LeadObjec_ConvexHull {}
 
std::unique_ptr< Game::NashGamenashgame
 The EPEC nash game. More...
 
std::vector< unsigned int > LeaderLocations {}
 
std::vector< const unsigned int * > LocEnds {}
 
std::vector< unsigned int > convexHullVariables {}
 
unsigned int n_MCVar {0}
 
GRBEnv * env
 
bool finalized {false}
 
bool nashEq {false}
 
std::chrono::high_resolution_clock::time_point initTime
 
EPECStatistics Stats {}
 Store run time information. More...
 
arma::vec sol_z
 Solution equation values. More...
 
arma::vec sol_x
 Solution variable values. More...
 

Private Member Functions

void add_Dummy_Lead (const unsigned int i)
 Add Dummy variables for the leaders. More...
 
void make_country_QP (const unsigned int i)
 Makes the Game::QP_Param corresponding to the i-th country. More...
 
void make_country_QP ()
 Makes the Game::QP_Param for all the countries. More...
 
void make_country_LCP ()
 
void resetLCP ()
 
void iterativeNash ()
 
void fullEnumerationNash ()
 
void combinatorial_pure_NE (const std::vector< long int > combination, const std::vector< std::set< unsigned long int >> &excludeList)
 
void combinatorialPNE (const std::vector< long int > combination={}, const std::vector< std::set< unsigned long int >> &excludeList={})
 
void make_pure_LCP (bool indicators=false)
 
void computeLeaderLocations (const unsigned int addSpaceForMC=0)
 
bool getAllDevns (std::vector< arma::vec > &devns, const arma::vec &guessSol, const std::vector< arma::vec > &prevDev={}) const
 Given a potential solution vector, returns a profitable deviation (if it exists) for all players. More...
 
unsigned int addDeviatedPolyhedron (const std::vector< arma::vec > &devns, bool &infeasCheck) const
 
void get_x_minus_i (const arma::vec &x, const unsigned int &i, arma::vec &solOther) const
 
bool computeNashEq (bool pureNE=false, double localTimeLimit=-1.0, bool check=false)
 
bool addRandomPoly2All (unsigned int aggressiveLevel=1, bool stopOnSingleInfeasibility=false)
 

Private Attributes

std::vector< unsigned int > SizesWithoutHull {}
 
Game::EPECalgorithm algorithm
 used by the EPEC. More...
 
std::unique_ptr< Game::LCPlcp
 The EPEC nash game written as an LCP. More...
 
std::unique_ptr< GRBModel > lcpmodel
 A Gurobi mode object of the LCP form of EPEC. More...
 
std::unique_ptr< GRBModel > lcpmodel_base
 
unsigned int nVarinEPEC {0}
 
unsigned int nCountr {0}
 

Detailed Description

Class to handle a Nash game between leaders of Stackelberg games.

Definition at line 475 of file games.h.

Constructor & Destructor Documentation

◆ EPEC() [1/3]

Game::EPEC::EPEC ( GRBEnv *  env)
inlineprotected

Definition at line 554 of file games.h.

◆ EPEC() [2/3]

Game::EPEC::EPEC ( )
delete

◆ EPEC() [3/3]

Game::EPEC::EPEC ( EPEC )
delete

◆ ~EPEC()

Game::EPEC::~EPEC ( )
inline

Definition at line 581 of file games.h.

Member Function Documentation

◆ add_Dummy_Lead()

void Game::EPEC::add_Dummy_Lead ( const unsigned int  i)
private

Add Dummy variables for the leaders.

Adds dummy variables to the leader of an EPEC - useful after computing the convex hull.

Parameters
iThe leader to whom dummy variables should be added

Definition at line 1291 of file Games.cpp.

◆ addDeviatedPolyhedron()

unsigned int Game::EPEC::addDeviatedPolyhedron ( const std::vector< arma::vec > &  devns,
bool &  infeasCheck 
) const
private

Given a profitable deviation for each country, adds a polyhedron in the feasible region of each country to the corresponding country's Game::LCP object (this->countries_LCP.at(i)) 's vector of feasible polyhedra.

Naturally, this makes the inner approximation of the Game::LCP better, by including one additional polyhedron.

Parameters
devnsdevns.at(i) is a profitable deviation for the i-th country from the current this->sol_x
infeasCheckUseful for the first iteration of iterativeNash. If true, at least one player has no polyhedron that can be added. In the first iteration, this translates to infeasability

Definition at line 1622 of file Games.cpp.

◆ addRandomPoly2All()

bool Game::EPEC::addRandomPoly2All ( unsigned int  aggressiveLevel = 1,
bool  stopOnSingleInfeasibility = false 
)
private

Makes a call to to Game::LCP::addAPoly for each member in Game::EPEC::countries_LCP and tries to add a polyhedron to get a better inner approximation for the LCP. aggressiveLevel is the maximum number of polyhedra it will try to add to each country. Setting it to an arbitrarily high value will mimic complete enumeration.

If stopOnSingleInfeasibility is true, then the function returns false and aborts all operation as soon as it finds that it cannot add polyhedra to some country. On the other hand if stopOnSingleInfeasibility is false, the function returns false, only if it is not possible to add polyhedra to any of the countries.

Returns
true if successfully added the maximum possible number of polyhedra not greater than aggressiveLevel.

Definition at line 1662 of file Games.cpp.

◆ combinatorial_pure_NE()

void Game::EPEC::combinatorial_pure_NE ( const std::vector< long int >  combination,
const std::vector< std::set< unsigned long int >> &  excludeList 
)
private

Definition at line 1849 of file Games.cpp.

◆ combinatorialPNE()

void Game::EPEC::combinatorialPNE ( const std::vector< long int >  combination = {},
const std::vector< std::set< unsigned long int >> &  excludeList = {} 
)
private

Definition at line 2161 of file Games.cpp.

◆ computeLeaderLocations()

void Game::EPEC::computeLeaderLocations ( const unsigned int  addSpaceForMC = 0)
private

Definition at line 1324 of file Games.cpp.

◆ computeNashEq()

bool Game::EPEC::computeNashEq ( bool  pureNE = false,
double  localTimeLimit = -1.0,
bool  check = false 
)
private

Given that Game::EPEC::country_QP are all filled with a each country's Game::QP_Param problem (either exact or approximate), computes the Nash equilibrium.

Returns
true if a Nash equilibrium is found
Parameters
pureNETrue if we search for a PNE
localTimeLimitAllowed time limit to run this function
checkIf true, the algorithm will seek for the maximum number of NE. Then, it will check they are equilibria for the original problem

Definition at line 1976 of file Games.cpp.

◆ finalize()

void Game::EPEC::finalize ( )

Finalizes the creation of a Game::EPEC object.

Performs a bunch of job after all data for a Game::EPEC object are given, namely. Models::EPEC::computeLeaderLocations - Adds the required dummy variables to each leader's problem so that a game among the leaders can be defined. Calls Game::EPEC::add_Dummy_Lead

  • Makes the market clearing constraint in each country. Calls

Game::EPEC::prefinalize() can be overridden, and that code will run before calling Game::EPEC::finalize()

Game::EPEC::postfinalize() can be overridden, and that code will run after calling Game::EPEC::finalize()

Definition at line 1226 of file Games.cpp.

◆ findNashEq()

void Game::EPEC::findNashEq ( )

Computes Nash equilibrium using the algorithm set in Game::EPEC::algorithm

Checks the value of Game::EPEC::algorithm and delegates the task to appropriate algorithm wrappers.

Definition at line 2182 of file Games.cpp.

◆ fullEnumerationNash()

void Game::EPEC::fullEnumerationNash ( )
private

Definition at line 2249 of file Games.cpp.

◆ get_x_minus_i()

void EPEC::get_x_minus_i ( const arma::vec &  x,
const unsigned int &  i,
arma::vec &  solOther 
) const
private

Definition at line 1335 of file Games.cpp.

◆ getAddPolyMethod()

Game::EPECAddPolyMethod Game::EPEC::getAddPolyMethod ( ) const
inline

Definition at line 644 of file games.h.

◆ getAddPolyMethodSeed()

unsigned int Game::EPEC::getAddPolyMethodSeed ( ) const
inline

Definition at line 624 of file games.h.

◆ getAggressiveness()

unsigned int Game::EPEC::getAggressiveness ( ) const
inline

Definition at line 611 of file games.h.

◆ getAlgorithm()

Game::EPECalgorithm Game::EPEC::getAlgorithm ( ) const
inline

Definition at line 601 of file games.h.

◆ getAllDevns()

bool Game::EPEC::getAllDevns ( std::vector< arma::vec > &  devns,
const arma::vec &  guessSol,
const std::vector< arma::vec > &  prevDev = {} 
) const
private

Given a potential solution vector, returns a profitable deviation (if it exists) for all players.

Parameters
Parameters
[out]devnsThe vector of deviations for all players
[in]guessSolThe guess for the solution vector

Definition at line 1593 of file Games.cpp.

◆ getBoundBigM()

double Game::EPEC::getBoundBigM ( ) const
inline

Definition at line 638 of file games.h.

◆ getBoundPrimals()

bool Game::EPEC::getBoundPrimals ( ) const
inline

Definition at line 634 of file games.h.

◆ getIndicators()

bool Game::EPEC::getIndicators ( ) const
inline

Definition at line 628 of file games.h.

◆ getLcpDescr()

const LCP& Game::EPEC::getLcpDescr ( ) const
inline

Get the Game::LCP object solved in the last iteration either to solve the problem or to prove non-existence of Nash equilibrium. Object is returned using constant reference.

Definition at line 689 of file games.h.

◆ getLcpModel()

const GRBModel& Game::EPEC::getLcpModel ( ) const
inline

Get the GRBModel solved in the last iteration to solve the problem or to prove non-existence of Nash equilibrium. Object is returned using constant reference.

Definition at line 693 of file games.h.

◆ getNcountries()

unsigned int Game::EPEC::getNcountries ( ) const
inlinenoexcept

Definition at line 651 of file games.h.

◆ getNPoly_Lead()

unsigned int Game::EPEC::getNPoly_Lead ( const unsigned int  i) const

Get the number of polyhedra used in the inner approximation of the feasible region of the i-th leader.*

Definition at line 2341 of file Games.cpp.

◆ getNumThreads()

unsigned int Game::EPEC::getNumThreads ( ) const
inline

Definition at line 618 of file games.h.

◆ getnVarinEPEC()

unsigned int Game::EPEC::getnVarinEPEC ( ) const
inlinenoexcept

Definition at line 650 of file games.h.

◆ getPosition_LeadFoll()

unsigned int Game::EPEC::getPosition_LeadFoll ( const unsigned int  i,
const unsigned int  j 
) const

Get the position of the j-th Follower variable in the i-th leader Querying Game::EPEC::lcpmodel for x[return-value] variable gives the appropriate variable

Definition at line 2291 of file Games.cpp.

◆ getPosition_LeadFollPoly()

unsigned int Game::EPEC::getPosition_LeadFollPoly ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
) const

Get the position of the k-th follower variable of the i-th leader, in the j-th feasible polyhedron.

Indeed it should hold that $ j < $ Game::EPEC::getNPoly_Lead(i)

Definition at line 2313 of file Games.cpp.

◆ getPosition_LeadLead()

unsigned int Game::EPEC::getPosition_LeadLead ( const unsigned int  i,
const unsigned int  j 
) const

Get the position of the j-th Follower variable in the i-th leader Querying Game::EPEC::lcpmodel for x[return-value] variable gives the appropriate variable

Definition at line 2302 of file Games.cpp.

◆ getPosition_LeadLeadPoly()

unsigned int Game::EPEC::getPosition_LeadLeadPoly ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
) const

Get the position of the k-th leader variable of the i-th leader, in the j-th feasible polyhedron.

Indeed it should hold that $ j < $ Game::EPEC::getNPoly_Lead(i)

Definition at line 2327 of file Games.cpp.

◆ getPosition_Probab()

unsigned int Game::EPEC::getPosition_Probab ( const unsigned int  i,
const unsigned int  k 
) const

Get the position of the probability associated with the k-th polyhedron (k-th pure strategy) of the i-th leader. However, if the leader has an inner approximation with exactly 1 polyhedron, it returns 0;

Definition at line 2349 of file Games.cpp.

◆ getPureNE()

bool Game::EPEC::getPureNE ( ) const
inline

Definition at line 630 of file games.h.

◆ getRecoverStrategy()

Game::EPECRecoverStrategy Game::EPEC::getRecoverStrategy ( ) const
inline

Definition at line 605 of file games.h.

◆ getStatistics()

const EPECStatistics Game::EPEC::getStatistics ( ) const
inline

Get the EPECStatistics object for the current instance.

Definition at line 599 of file games.h.

◆ getTimeLimit()

double Game::EPEC::getTimeLimit ( ) const
inline

Definition at line 640 of file games.h.

◆ getVal_LeadFoll()

double Game::EPEC::getVal_LeadFoll ( const unsigned int  i,
const unsigned int  j 
) const

Definition at line 2418 of file Games.cpp.

◆ getVal_LeadFollPoly()

double Game::EPEC::getVal_LeadFollPoly ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k,
const double  tol = 1e-5 
) const

Definition at line 2438 of file Games.cpp.

◆ getVal_LeadLead()

double Game::EPEC::getVal_LeadLead ( const unsigned int  i,
const unsigned int  j 
) const

Definition at line 2428 of file Games.cpp.

◆ getVal_LeadLeadPoly()

double Game::EPEC::getVal_LeadLeadPoly ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k,
const double  tol = 1e-5 
) const

Definition at line 2456 of file Games.cpp.

◆ getVal_Probab()

double Game::EPEC::getVal_Probab ( const unsigned int  i,
const unsigned int  k 
) const

Definition at line 2409 of file Games.cpp.

◆ getx()

const arma::vec Game::EPEC::getx ( ) const
inline

Definition at line 595 of file games.h.

◆ getz()

const arma::vec Game::EPEC::getz ( ) const
inline

Definition at line 597 of file games.h.

◆ hasLCP()

bool Game::EPEC::hasLCP ( ) const
inlineprotected

Definition at line 571 of file games.h.

◆ isPureStrategy() [1/2]

bool Game::EPEC::isPureStrategy ( const unsigned int  i,
const double  tol = 1e-5 
) const

Checks if the returned strategy leader is a pure strategy for the leader i. The strategy is considered a pure strategy, if it is played with a probability greater than 1 - tol;

Definition at line 2376 of file Games.cpp.

◆ isPureStrategy() [2/2]

bool Game::EPEC::isPureStrategy ( const double  tol = 1e-5) const

Checks if the returned strategy leader is a pure strategy for the leader i. The strategy is considered a pure strategy, if it is played with a probability greater than 1 - tol;

Definition at line 2363 of file Games.cpp.

◆ isSolved() [1/2]

bool Game::EPEC::isSolved ( unsigned int *  countryNumber,
arma::vec *  ProfDevn,
double  tol = 51e-4 
) const

Checks if Game::EPEC is solved, else returns proof of unsolvedness.

Analogous to Game::NashGame::isSolved but checks if the given Game::EPEC is solved. If it is solved, then retruns true. If not, it returns the country which has a profitable deviation in countryNumber and the profitable deviation in ProfDevn. tol is the tolerance for the check. If the improved objective after the deviation is less than tol, then it is not considered as a profitable deviation.

Thus we check if the given point is an $\epsilon$-equilibrium. Value of $\epsilon $ can be chosen sufficiently close to 0.

Warning
Setting tol = 0 might even reject a real solution as not solved. This is due to numerical issues arising from the LCP solver (Gurobi).

Definition at line 1450 of file Games.cpp.

◆ isSolved() [2/2]

bool Game::EPEC::isSolved ( double  tol = 51e-4) const

Definition at line 1491 of file Games.cpp.

◆ iterativeNash()

void Game::EPEC::iterativeNash ( )
private

Definition at line 1698 of file Games.cpp.

◆ make_country_LCP()

void Game::EPEC::make_country_LCP ( )
private

◆ make_country_QP() [1/2]

void Game::EPEC::make_country_QP ( const unsigned int  i)
private

Makes the Game::QP_Param corresponding to the i-th country.

Definition at line 1498 of file Games.cpp.

◆ make_country_QP() [2/2]

void Game::EPEC::make_country_QP ( )
private

Makes the Game::QP_Param for all the countries.

Calls are made to Models::EPEC::make_country_QP(const unsigned int i) for each valid i

Note
Overloaded as EPEC::make_country_QP(unsigned int)

Definition at line 1534 of file Games.cpp.

◆ make_MC_cons()

virtual void Game::EPEC::make_MC_cons ( arma::sp_mat &  MC,
arma::vec &  RHS 
) const
inlineprotectedvirtual

Reimplemented in Models::EPEC.

Definition at line 567 of file games.h.

◆ make_obj_leader()

virtual void Game::EPEC::make_obj_leader ( const unsigned int  i,
Game::QP_objective QP_obj 
)
protectedpure virtual

Can be instantiated by a derived class only!

Implemented in Models::EPEC, and My_EPEC_Prob.

◆ make_pure_LCP()

void Game::EPEC::make_pure_LCP ( bool  indicators = false)
private

Given that Game::EPEC::lcpmodel is filled with the final LCP, directs the search toward a pure nash EQ. If such an equilibrium does not exist, then the model will return anyway a MNE. The original LCP is stored in the field Game::EPEC::lcpmodel_base. indicators dictates whether the resulting LCP should use indicator constraints instead of general binaries. In general, there are advantages in using the binary variables instead of such constraints, since there is no bigM involved in the formulation.

Definition at line 2098 of file Games.cpp.

◆ mixedStratPoly()

std::vector< unsigned int > Game::EPEC::mixedStratPoly ( const unsigned int  i,
const double  tol = 1e-5 
) const

Returns the indices of polyhedra feasible for the leader, from which strategies are played with probability greater than tol.

Definition at line 2391 of file Games.cpp.

◆ postfinalize()

void Game::EPEC::postfinalize ( )
protectedvirtual

Empty function - optionally reimplementable in derived class.

This function can be optionally implemented by the derived class. Code in this class will be run after calling Game::EPEC::finalize().

Reimplemented in Models::EPEC.

Definition at line 1203 of file Games.cpp.

◆ prefinalize()

void Game::EPEC::prefinalize ( )
protectedvirtual

Empty function - optionally reimplementable in derived class.

This function can be optionally implemented by the derived class. Code in this class will be run before calling Game::EPEC::finalize().

Reimplemented in Models::EPEC.

Definition at line 1194 of file Games.cpp.

◆ reset()

void Game::EPEC::reset ( )
inline

Definition at line 596 of file games.h.

◆ resetLCP()

void Game::EPEC::resetLCP ( )
private

Resets the LCP objects to blank objects with no polyhedron added. Useful in testing, or resolving a problem with a different algorithm.

Definition at line 1212 of file Games.cpp.

◆ Respond()

unique_ptr< GRBModel > Game::EPEC::Respond ( const unsigned int  i,
const arma::vec &  x 
) const

Definition at line 1366 of file Games.cpp.

◆ RespondSol()

double Game::EPEC::RespondSol ( arma::vec &  sol,
unsigned int  player,
const arma::vec &  x,
const arma::vec &  prevDev = {} 
) const

Returns the optimal objective value that is obtainable for the player player given the decision x of all other players.

Calls Game::EPEC::Respond and obtains the unique_ptr to GRBModel of best response by player player. Then solves the model and returns the appropriate objective value.

Returns
The optimal objective value for the player player.
Parameters
solOptimal response
playerPlayer whose optimal response is to be computed
xA vector of pure strategies (either for all players or all other players

Definition at line 1380 of file Games.cpp.

◆ setAddPolyMethod()

void Game::EPEC::setAddPolyMethod ( Game::EPECAddPolyMethod  add)
inline

Definition at line 641 of file games.h.

◆ setAddPolyMethodSeed()

void Game::EPEC::setAddPolyMethodSeed ( unsigned int  t)
inline

Definition at line 621 of file games.h.

◆ setAggressiveness()

void Game::EPEC::setAggressiveness ( unsigned int  a)
inline

Definition at line 608 of file games.h.

◆ setAlgorithm()

void Game::EPEC::setAlgorithm ( Game::EPECalgorithm  algorithm)

Decides the algorithm to be used for solving the given instance of the problem. The choice of algorithms are documented in Game::EPECalgorithm

Definition at line 2274 of file Games.cpp.

◆ setBoundBigM()

void Game::EPEC::setBoundBigM ( double  val)
inline

Definition at line 637 of file games.h.

◆ setBoundPrimals()

void Game::EPEC::setBoundPrimals ( bool  val)
inline

Definition at line 631 of file games.h.

◆ setIndicators()

void Game::EPEC::setIndicators ( bool  val)
inline

Definition at line 627 of file games.h.

◆ setNumThreads()

void Game::EPEC::setNumThreads ( unsigned int  t)
inline

Definition at line 614 of file games.h.

◆ setPureNE()

void Game::EPEC::setPureNE ( bool  val)
inline

Definition at line 629 of file games.h.

◆ setRecoverStrategy()

void Game::EPEC::setRecoverStrategy ( Game::EPECRecoverStrategy  strategy)

Decides the algorithm to be used for recovering a PNE out of the innerApproximation procedure.

Definition at line 2282 of file Games.cpp.

◆ setTimeLimit()

void Game::EPEC::setTimeLimit ( double  val)
inline

Definition at line 639 of file games.h.

◆ updateLocs()

virtual void Game::EPEC::updateLocs ( )
protectedpure virtual

Implemented in Models::EPEC, and My_EPEC_Prob.

◆ warmstart()

bool Game::EPEC::warmstart ( const arma::vec  x)
protected

Warmstarts EPEC with a solution.

Todo:
Game::EPEC::warmstart - to complete implementation?

Definition at line 2060 of file Games.cpp.

◆ writeLcpModel()

void Game::EPEC::writeLcpModel ( std::string  filename) const
inline

Writes the GRBModel solved in the last iteration to solve the problem or to prove non-existence of Nash equilibrium to a file.

Definition at line 696 of file games.h.

Field Documentation

◆ algorithm

Game::EPECalgorithm Game::EPEC::algorithm
private
Initial value:

used by the EPEC.

Stores the type of algorithm

Definition at line 478 of file games.h.

◆ convexHullVariables

std::vector<unsigned int> Game::EPEC::convexHullVariables {}
protected

Definition at line 512 of file games.h.

◆ countries_LCP

std::vector<std::unique_ptr<Game::LCP> > Game::EPEC::countries_LCP {}
protected

Definition at line 494 of file games.h.

◆ countries_LL

std::vector<std::shared_ptr<Game::NashGame> > Game::EPEC::countries_LL {}
protected

Definition at line 493 of file games.h.

◆ country_QP

std::vector<std::shared_ptr<Game::QP_Param> > Game::EPEC::country_QP {}
protected

The QP corresponding to each player.

Definition at line 497 of file games.h.

◆ env

GRBEnv* Game::EPEC::env
protected

Definition at line 515 of file games.h.

◆ finalized

bool Game::EPEC::finalized {false}
protected

Definition at line 516 of file games.h.

◆ initTime

std::chrono::high_resolution_clock::time_point Game::EPEC::initTime
protected

Definition at line 518 of file games.h.

◆ lcp

std::unique_ptr<Game::LCP> Game::EPEC::lcp
private

The EPEC nash game written as an LCP.

Definition at line 481 of file games.h.

◆ lcpmodel

std::unique_ptr<GRBModel> Game::EPEC::lcpmodel
private

A Gurobi mode object of the LCP form of EPEC.

Definition at line 483 of file games.h.

◆ lcpmodel_base

std::unique_ptr<GRBModel> Game::EPEC::lcpmodel_base
private

A Gurobi mode object of the LCP form of EPEC. If we are searching for a pure NE, the LCP which is indifferent to pure or mixed NE is stored in this object.

Definition at line 485 of file games.h.

◆ LeaderLocations

std::vector<unsigned int> Game::EPEC::LeaderLocations {}
protected

Location of each leader

Definition at line 506 of file games.h.

◆ LeadObjec

std::vector<std::shared_ptr<Game::QP_objective> > Game::EPEC::LeadObjec {}
protected

Objective of each leader.

Definition at line 499 of file games.h.

◆ LeadObjec_ConvexHull

std::vector<std::shared_ptr<Game::QP_objective> > Game::EPEC::LeadObjec_ConvexHull {}
protected

Objective of each leader, given the convex hull computation

Definition at line 501 of file games.h.

◆ LocEnds

std::vector<const unsigned int *> Game::EPEC::LocEnds {}
protected

Number of variables in the current player, including any number of convex hull variables at the current moment. The used, i.e., the inheritor of Game::EPEC has the responsibility to keep this correct by implementing an override of Game::EPEC::updateLocs.

Definition at line 511 of file games.h.

◆ n_MCVar

unsigned int Game::EPEC::n_MCVar {0}
protected

Definition at line 513 of file games.h.

◆ nashEq

bool Game::EPEC::nashEq {false}
protected

Definition at line 517 of file games.h.

◆ nashgame

std::unique_ptr<Game::NashGame> Game::EPEC::nashgame
protected

The EPEC nash game.

Definition at line 504 of file games.h.

◆ nCountr

unsigned int Game::EPEC::nCountr {0}
private

Definition at line 490 of file games.h.

◆ nVarinEPEC

unsigned int Game::EPEC::nVarinEPEC {0}
private

Definition at line 489 of file games.h.

◆ SizesWithoutHull

std::vector<unsigned int> Game::EPEC::SizesWithoutHull {}
private

Definition at line 477 of file games.h.

◆ sol_x

arma::vec Game::EPEC::sol_x
protected

Solution variable values.

Definition at line 520 of file games.h.

◆ sol_z

arma::vec Game::EPEC::sol_z
protected

Solution equation values.

Definition at line 520 of file games.h.

◆ Stats

EPECStatistics Game::EPEC::Stats {}
protected

Store run time information.

Definition at line 519 of file games.h.


The documentation for this class was generated from the following files: