EPEC solve
Solving Equilibrium Problems with Equilibrium Constraints (EPECs)
|
Public Member Functions | |
My_EPEC_Prob (GRBEnv *e) | |
void | addLeader (std::shared_ptr< Game::NashGame > N, const unsigned int i) |
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 LCP & | getLcpDescr () 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... | |
virtual void | prefinalize () |
Empty function - optionally reimplementable in derived class. More... | |
virtual void | postfinalize () |
Empty function - optionally reimplementable in derived class. More... | |
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::NashGame > | nashgame |
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 | updateLocs () override |
void | make_obj_leader (const unsigned int i, Game::QP_objective &QP_obj) override |
Can be instantiated by a derived class only! More... | |
Private Attributes | |
unsigned int | ends [2] |
Definition at line 7 of file example.cpp.
|
inline |
Definition at line 9 of file example.cpp.
|
inline |
Definition at line 10 of file example.cpp.
|
inherited |
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
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()
|
inherited |
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.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinenoexceptinherited |
|
inherited |
|
inlineinherited |
|
inlinenoexceptinherited |
|
inherited |
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
|
inherited |
|
inherited |
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
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
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 -equilibrium. Value of can be chosen sufficiently close to 0.
tol
= 0 might even reject a real solution as not solved. This is due to numerical issues arising from the LCP solver (Gurobi).
|
inherited |
|
inlineprotectedvirtualinherited |
Reimplemented in Models::EPEC.
|
inlineoverrideprivatevirtual |
Can be instantiated by a derived class only!
Implements Game::EPEC.
Definition at line 22 of file example.cpp.
|
inherited |
|
protectedvirtualinherited |
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.
|
protectedvirtualinherited |
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.
|
inherited |
|
inherited |
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.
player
.[out] | sol | Optimal response |
player | Player whose optimal response is to be computed | |
x | A vector of pure strategies (either for all players or all other players |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
Decides the algorithm to be used for solving the given instance of the problem. The choice of algorithms are documented in Game::EPECalgorithm
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineoverrideprivatevirtual |
Implements Game::EPEC.
Definition at line 18 of file example.cpp.
|
protectedinherited |
Warmstarts EPEC with a solution.
|
inlineinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
private |
Definition at line 17 of file example.cpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
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.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |