22 #ifndef _SGSIMULATOR_HPP
23 #define _SGSIMULATOR_HPP
25 #include "sgsolution_pencilsharpening.hpp"
75 typedef pair< list<SGIteration_PencilSharpening>::const_iterator,
double > transitionPair;
117 std::stringstream
ss;
152 void simulate(
int _numSim,
int _numIter,
int initialState,
int initialTuple);
163 action <
soln.
getGame().getNumActions_total()[state];
vector< vector< list< transitionPair > > > transitionTable
The transition table.
Definition: sgsimulator.hpp:91
SGPoint getLongRunPayoffs()
Returns the long run action distribution.
Definition: sgsimulator.hpp:155
void simulate(int _numSim, int _numIter, int initialState, int initialTuple)
Forward simulates the equilibrium.
Definition: sgsimulator.cpp:244
const std::stringstream & getStringStream() const
Returns the stringstream describing the first 200 periods.
Definition: sgsimulator.hpp:143
const vector< vector< SGPoint > > & getPayoffs() const
Returns a const reference to the payoffs.
Definition: sggame.hpp:191
const vector< int > getStateDistr() const
Returns the state frequency distribution.
Definition: sgsimulator.hpp:131
const SGGame & getGame() const
Get method for the game.
Definition: sgsolution_pencilsharpening.hpp:59
bool logFlag
True if saving log information to the stringstreams.
Definition: sgsimulator.hpp:110
vector< int > stateDistr
Definition: sgsimulator.hpp:102
int getNumIter() const
Returns the number of iterations for the current simulation.
Definition: sgsimulator.hpp:137
double weightTol
Tolerance for computing the transition table.
Definition: sgsimulator.hpp:113
vector< int > tupleDistr
Definition: sgsimulator.hpp:99
int numSim
The number of simulations to run.
Definition: sgsimulator.hpp:105
Records the progress of SGSolver::solve().
Definition: sgsolution_pencilsharpening.hpp:41
const vector< int > getTupleDistr() const
Returns the tuple frequency distribution.
Definition: sgsimulator.hpp:133
void initialize()
Initializes the transition table.
Definition: sgsimulator.cpp:24
list< SGIteration_PencilSharpening >::const_iterator startOfLastRev
Points to the beginning of the last revolution.
Definition: sgsimulator.hpp:82
vector< vector< int > > actionDistr
The distribution of actions in each state.
Definition: sgsimulator.hpp:96
const vector< vector< int > > getActionDistr() const
Returns the action frequency distributions.
Definition: sgsimulator.hpp:129
A vector in .
Definition: sgpoint.hpp:35
const SGSolution_PencilSharpening & soln
The associated SGSolution object.
Definition: sgsimulator.hpp:79
SGSimulator(const SGSolution_PencilSharpening &_soln)
Constructor.
Definition: sgsimulator.hpp:124
std::stringstream ss
Definition: sgsimulator.hpp:117
Class for forward simulating equilibria.
Definition: sgsimulator.hpp:74
const std::stringstream & getTransitionTableStringStream() const
Returns the stringstream describing the transition table.
Definition: sgsimulator.hpp:145
int numIter
The number of periods for each simulation.
Definition: sgsimulator.hpp:107
std::stringstream transitionTableSS
Contains a text description of the transition table.
Definition: sgsimulator.hpp:120
void setLogFlag(bool newFlag)
Mutator method for the log flag.
Definition: sgsimulator.hpp:140
int getStartOfLastRev() const
Returns the start of the last revolution.
Definition: sgsimulator.hpp:135