SGSolve
|
N-player prisoners' contribution game. More...
#include <sgcontribution.hpp>
Public Member Functions | |
ContributionGame (int _numPlayers, double _delta, int _numStates) | |
virtual SGPoint | payoffs (int state, const vector< int > &actions) const |
The payoff function. More... | |
virtual double | probability (int state, const vector< int > &actions, int statep) const |
Transition probabilities. More... | |
Public Member Functions inherited from SGAbstractGame | |
SGAbstractGame (int _numPlayers, double _delta, int _numStates, vector< vector< int > > _numActions) | |
Constructor for the pure virtual class. | |
SGAbstractGame (double _delta, int _numStates, vector< vector< int > > _numActions) | |
Constructor for the pure virtual class. More... | |
virtual bool | isEquilibriumAction (int state, const vector< int > &actions) const |
virtual bool | constrained (int player) const |
Returns true if the given player is incentive constrained. More... | |
SGPoint | payoffs (int state, int action) const |
An overloaded version of payoffs that uses a linear action index. More... | |
double | probability (int state, int action, int statep) const |
bool | isEquilibriumAction (int state, int action) const |
int | getNumPlayers () const |
Returns the number of players. | |
double | getDelta () const |
Returns the discount factor. | |
double | getNumStates () const |
Returns the number of states. | |
const vector< vector< int > > | getNumActions () const |
Returns the number of actions array. | |
Additional Inherited Members | |
Protected Member Functions inherited from SGAbstractGame | |
vector< int > | indexToActions (int index, int state) const |
Converts a linear index to multiindex. More... | |
Protected Attributes inherited from SGAbstractGame | |
int | numPlayers |
The number of players, always 2. | |
double | delta |
The discount factor. | |
int | numStates |
The number of states. | |
vector< vector< int > > | numActions |
The numbers of actions in each state. More... | |
N-player prisoners' contribution game.
< This class implements a multi-player prisoners' dilemma with two states and uniform transition probabilities.
|
inlinevirtual |
The payoff function.
A class that is derived from SGAbstractGame must define the payoffs method, which returns, for a given state and action pair, the flow payoffs that the players receive as an SGPoint.
Implements SGAbstractGame.
|
inlinevirtual |
Transition probabilities.
A class that derives from SGAbstractGame must define the probability method, which gives, for each state and action pair and new state, the probability of reaching the new state tomorrow when starting from the given state and when the given action pair is played.
Implements SGAbstractGame.