22 #ifndef _SGCONTRIBUTION_HPP
23 #define _SGCONTRIBUTION_HPP
39 vector< vector<int> >(_numStates,vector<int>(_numPlayers,2)))
46 double actionSum = 0.0;
48 actionSum += actions[p];
52 point[p] = 2.0*actionSum - 3.0*actions[p]
53 + 20.0*
static_cast<double>(state)/(
static_cast<double>(
numStates)-1.0);
58 virtual double probability(
int state,
const vector<int> & actions,
int statep)
const
60 return 1.0/
static_cast<double>(
numStates);
int numPlayers
The number of players, always 2.
Definition: sgabstractgame.hpp:44
virtual double probability(int state, const vector< int > &actions, int statep) const
Transition probabilities.
Definition: sgcontribution.hpp:58
int numStates
The number of states.
Definition: sgabstractgame.hpp:48
virtual SGPoint payoffs(int state, const vector< int > &actions) const
The payoff function.
Definition: sgcontribution.hpp:42
A virtual class for constructing games.
Definition: sgabstractgame.hpp:41
A vector in .
Definition: sgpoint.hpp:35
SGAbstractGame(int _numPlayers, double _delta, int _numStates, vector< vector< int > > _numActions)
Constructor for the pure virtual class.
Definition: sgabstractgame.hpp:70
N-player prisoners' contribution game.
Definition: sgcontribution.hpp:31