MultiAgentDecisionProcess
SimulationDecPOMDPDiscrete Class Reference

SimulationDecPOMDPDiscrete simulates policies in DecPOMDPDiscrete's. More...

#include <SimulationDecPOMDPDiscrete.h>

Inheritance diagram for SimulationDecPOMDPDiscrete:
[legend]

Public Member Functions

SimulationResult RunSimulations (const JointPolicyDiscrete *jp) const
 Run simulations using a particular discrete joint policy. More...
 
SimulationResult RunSimulations (const boost::shared_ptr< JointPolicyDiscrete > &jp) const
 Run simulations using a particular discrete joint policy. More...
 
template<class A >
SimulationResult RunSimulations (const std::vector< A * > &agents) const
 Run simulations using a vector of SimulationAgent. More...
 
void SaveIntermediateResults (std::string filename)
 Indicate that intermediate should be stored to file named filename. More...
 
 SimulationDecPOMDPDiscrete (const PlanningUnitDecPOMDPDiscrete &pu, int nrRuns, int seed=illegalRandomSeed, bool verbose=false)
 Constructor specifying the number of runs and the random seed. More...
 
 SimulationDecPOMDPDiscrete (const PlanningUnitDecPOMDPDiscrete &pu, const ArgumentHandlers::Arguments &args)
 Constructor which parses the command-line arguments. More...
 
 ~SimulationDecPOMDPDiscrete ()
 Destructor. More...
 
- Public Member Functions inherited from Simulation
int GetNrRuns () const
 
int GetRandomSeed () const
 
bool GetVerbose () const
 
void SetRandomSeed (int s)
 
void SetVerbose (bool verbose)
 
 Simulation (int nrRuns, int seed=illegalRandomSeed)
 Constructor that specifies the number of runs and the random seed. More...
 
virtual ~Simulation ()
 Destructor. More...
 

Protected Attributes

size_t _m_horizon
 
std::string _m_intermediateResultsFilename
 
bool _m_saveIntermediateResults
 

Private Member Functions

Index GetAction (const std::vector< AgentLocalObservations * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, double &specialR) const
 
Index GetAction (const std::vector< AgentSharedObservations * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, double &specialR) const
 
Index GetAction (const std::vector< AgentDelayedSharedObservations * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, double &specialR) const
 
Index GetAction (const std::vector< AgentFullyObservable * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, double &specialR) const
 
void Initialize ()
 
void PreActHook (const std::vector< AgentLocalObservations * > &agents, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, Index prevSI, Index ts) const
 
void PreActHook (const std::vector< AgentSharedObservations * > &agents, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, Index prevSI, Index ts) const
 
void PreActHook (const std::vector< AgentDelayedSharedObservations * > &agents, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, Index prevSI, Index ts) const
 
void PreActHook (const std::vector< AgentFullyObservable * > &agents, Index jaI, Index joI, double r, Index prevJoI, Index sI, Index prevJaI, Index prevSI, Index ts) const
 
virtual double RunSimulation (const JointPolicyDiscrete *jp) const
 Simulate a run of a discrete joint policy. More...
 
double RunSimulationClusteredBG (const JointPolicyPureVectorForClusteredBG *jp) const
 Simulate a run of a JointPolicyPureVectorForClusteredBG. More...
 
void Step (Index jaI, unsigned int t, Index &sI, Index &joI, double &r, double &sumR, double specialR) const
 Perform one step of the simulation. More...
 

Private Attributes

const
PlanningUnitDecPOMDPDiscrete
_m_pu
 Pointer to the planning unit that generated the policy. More...
 

Additional Inherited Members

- Static Protected Attributes inherited from Simulation
static const int illegalRandomSeed =INT_MAX
 

Detailed Description

Constructor & Destructor Documentation

SimulationDecPOMDPDiscrete::SimulationDecPOMDPDiscrete ( const PlanningUnitDecPOMDPDiscrete pu,
int  nrRuns,
int  seed = illegalRandomSeed,
bool  verbose = false 
)

Constructor specifying the number of runs and the random seed.

References Initialize(), and Simulation::SetVerbose().

SimulationDecPOMDPDiscrete::SimulationDecPOMDPDiscrete ( const PlanningUnitDecPOMDPDiscrete pu,
const ArgumentHandlers::Arguments args 
)

Constructor which parses the command-line arguments.

References Initialize(), Simulation::SetVerbose(), and ArgumentHandlers::Arguments::verbose.

SimulationDecPOMDPDiscrete::~SimulationDecPOMDPDiscrete ( )

Destructor.

Member Function Documentation

Index SimulationDecPOMDPDiscrete::GetAction ( const std::vector< AgentLocalObservations * > &  agents,
Index  i,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
double &  specialR 
) const
private
Index SimulationDecPOMDPDiscrete::GetAction ( const std::vector< AgentSharedObservations * > &  agents,
Index  i,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
double &  specialR 
) const
private
Index SimulationDecPOMDPDiscrete::GetAction ( const std::vector< AgentDelayedSharedObservations * > &  agents,
Index  i,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
double &  specialR 
) const
private
Index SimulationDecPOMDPDiscrete::GetAction ( const std::vector< AgentFullyObservable * > &  agents,
Index  i,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
double &  specialR 
) const
private
void SimulationDecPOMDPDiscrete::PreActHook ( const std::vector< AgentLocalObservations * > &  agents,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
Index  prevSI,
Index  ts 
) const
inlineprivate

Referenced by RunSimulations().

void SimulationDecPOMDPDiscrete::PreActHook ( const std::vector< AgentSharedObservations * > &  agents,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
Index  prevSI,
Index  ts 
) const
inlineprivate
void SimulationDecPOMDPDiscrete::PreActHook ( const std::vector< AgentDelayedSharedObservations * > &  agents,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
Index  prevSI,
Index  ts 
) const
inlineprivate
void SimulationDecPOMDPDiscrete::PreActHook ( const std::vector< AgentFullyObservable * > &  agents,
Index  jaI,
Index  joI,
double  r,
Index  prevJoI,
Index  sI,
Index  prevJaI,
Index  prevSI,
Index  ts 
) const
inlineprivate
SimulationResult SimulationDecPOMDPDiscrete::RunSimulations ( const JointPolicyDiscrete jp) const
SimulationResult SimulationDecPOMDPDiscrete::RunSimulations ( const boost::shared_ptr< JointPolicyDiscrete > &  jp) const

Run simulations using a particular discrete joint policy.

References RunSimulations().

void SimulationDecPOMDPDiscrete::SaveIntermediateResults ( std::string  filename)

Indicate that intermediate should be stored to file named filename.

References _m_intermediateResultsFilename, and _m_saveIntermediateResults.

Member Data Documentation

std::string SimulationDecPOMDPDiscrete::_m_intermediateResultsFilename
protected
const PlanningUnitDecPOMDPDiscrete* SimulationDecPOMDPDiscrete::_m_pu
private

Pointer to the planning unit that generated the policy.

Referenced by GetAction(), Initialize(), RunSimulation(), RunSimulationClusteredBG(), and Step().

bool SimulationDecPOMDPDiscrete::_m_saveIntermediateResults
protected