SGSolve
|
Class for solving stochastic games. More...
#include <sgsolver_maxminmax_3player.hpp>
Public Member Functions | |
SGSolver_MaxMinMax_3Player () | |
Default constructor. | |
SGSolver_MaxMinMax_3Player (const SGEnv &_env, const SGGame &_game) | |
Constructor. More... | |
~SGSolver_MaxMinMax_3Player () | |
Destructor. | |
void | solve (const int numDirsApprox=200, const bool dropRedundant=true, const bool addEndogenous=true) |
Fixed direction solve routine. More... | |
void | solve_endogenous () |
Endogenous direction solve routine. More... | |
double | iterate_endogenous () |
One iteration of the endogenous algorithm. More... | |
double | iterate (const int maxDirections, const bool dropRedundant, const bool addEndogenous) |
One iteration of the algorithm. More... | |
void | initialize () |
Initializes the solve routines. | |
std::string | progressString () const |
void | optimizePolicy (SGTuple &pivot, vector< SGActionIter > &actionTuple, vector< SG::Regime > ®imeTuple, const SGPoint &currDir, const vector< list< SGAction_MaxMinMax > > &actions) const |
Optimizes the policy for the given direction. | |
bool | computeOptimalPolicies (SGProductPolicy &optPolicies, const SGTuple &pivot, const SGPoint &currDir, const vector< list< SGAction_MaxMinMax > > &actions) const |
double | sensitivity (SGPoint &optSubDir, const SGTuple &pivot, const SGPoint &currDir, const SGPoint &newDir, const vector< list< SGAction_MaxMinMax > > &actions) const |
void | policyToPayoffs (SGTuple &pivot, const vector< SGActionIter > &actionTuple, const vector< SG::Regime > ®imeTuple) const |
Converts a policy function to a payoff function using bellman iteration. | |
const SGSolution_MaxMinMax & | getSolution () const |
Private Attributes | |
const SGEnv & | env |
SGEnv object to hold parameters. | |
const SGGame & | game |
Constant reference to the game to be solved. | |
SGSolution_MaxMinMax | soln |
SGSolution object used by SGApprox to store data. | |
const double | delta |
const int | numPlayers |
const int | numStates |
const vector< vector< bool > > & | eqActions |
const vector< vector< SGPoint > > & | payoffs |
const vector< vector< vector< double > > > & | probabilities |
const vector< vector< int > > | numActions |
const vector< int > | numActions_totalByState |
list< SGPoint > | directions |
list< vector< double > > | levels |
list< SGPoint > | threatDirections |
SGTuple | threatTuple |
vector< list< SGAction_MaxMinMax > > | actions |
const SGPoint | dueEast = SGPoint(1.0,0.0) |
const SGPoint | dueNorth = SGPoint(0.0,1.0) |
int | numIter |
double | errorLevel |
SGPoint | payoffLB |
SGPoint | payoffUB |
int | numRedundDirs |
int | numEndogDirs |
bool | debugMode |
Class for solving stochastic games.
This class implements the max-min-max algorithm of Abreu, Brooks, and Sannikov (2019) for three players. It contains the parameters for the algorithm, the solve method, as well as the data structure produced by solve. It calculates the equilibrium payoff correspondence corresponding to an SGGame object.
Constructor.
Creates a new SGSolver_MaxMinMax_3Player object and initializes it with the given game.
bool SGSolver_MaxMinMax_3Player::computeOptimalPolicies | ( | SGProductPolicy & | optPolicies, |
const SGTuple & | pivot, | ||
const SGPoint & | currDir, | ||
const vector< list< SGAction_MaxMinMax > > & | actions | ||
) | const |
Compute all policies that are at least as high as the given pivot. Returns false if there is a strict improvement, and true otherwise. Will short circuit if it finds a strict improvement.
|
inline |
Returns a constant reference to the SGSolution_MaxMinMax object storing the output of the computation.
double SGSolver_MaxMinMax_3Player::iterate | ( | const int | maxDirections, |
const bool | dropRedundant, | ||
const bool | addEndogenous | ||
) |
One iteration of the algorithm.
Return the new error level.
double SGSolver_MaxMinMax_3Player::iterate_endogenous | ( | ) |
One iteration of the endogenous algorithm.
Return the new error level.
double SGSolver_MaxMinMax_3Player::sensitivity | ( | SGPoint & | optSubDir, |
const SGTuple & | pivot, | ||
const SGPoint & | currDir, | ||
const SGPoint & | newDir, | ||
const vector< list< SGAction_MaxMinMax > > & | actions | ||
) | const |
Find the next clockwise direction at which the optimal tuple changes
void SGSolver_MaxMinMax_3Player::solve | ( | const int | numDirsApprox = 200 , |
const bool | dropRedundant = true , |
||
const bool | addEndogenous = true |
||
) |
Fixed direction solve routine.
Initializes a new SGApproximation object and iteratively generates it until one of the stopping criteria have been met. Stores progress in the data member.
Drops redundant directions and adds new face directions.
void SGSolver_MaxMinMax_3Player::solve_endogenous | ( | ) |
Endogenous direction solve routine.
Initializes a new SGApproximation object and iteratively generates it until one of the stopping criteria have been met. Stores progress in the data member.
Generates directions endogenously.
|
private |
Actions that can still be played.
|
private |
Indicator for whether the program is being debugged.
|
private |
The discount factor, copied from SGApprox_V2::game.
|
private |
List of directions in which the algorithm bounds payoffs.
The direction due east.
The direction due north.
|
private |
Constant refernece to actions that are allowed to be played in equilibrium in the game.
|
private |
The current error level.
|
private |
List of optimal levels attained in the corresponding directions.
|
private |
Number of actions in the game.
|
private |
Total number of actions in each state.
|
private |
Number of endogenous directions added so far.
|
private |
The number of iterations computed thus far.
|
private |
The number of players, always 2.
|
private |
Number of redundant directions dropped so far.
|
private |
The number of states, copied from SGApprox_V2::game.
|
private |
Lower bound on payoffs across all states and actions.
|
private |
Constant reference to payoffs in the game.
|
private |
Upper bound on payoffs across all states and actions.
|
private |
Constant reference to transition probabilities in the game.
|
private |
The current threat payoffs.