MultiAgentDecisionProcess
Release 0.2.1
|
SimulationDecPOMDPDiscrete simulates policies in DecPOMDPDiscrete's. More...
#include <SimulationDecPOMDPDiscrete.h>
Public Member Functions | |
SimulationResult | RunSimulations (const JointPolicyDiscrete *jp) const |
Run simulations using a particular discrete joint policy. | |
template<class A > | |
SimulationResult | RunSimulations (const std::vector< A * > &agents) const |
Run simulations using a vector of SimulationAgent. | |
void | SaveIntermediateResults (std::string filename) |
Indicate that intermediate should be stored to file named filename. | |
SimulationDecPOMDPDiscrete (const PlanningUnitDecPOMDPDiscrete &pu, int nrRuns, int seed=illegalRandomSeed) | |
Constructor specifying the number of runs and the random seed. | |
SimulationDecPOMDPDiscrete (const PlanningUnitDecPOMDPDiscrete &pu, const ArgumentHandlers::Arguments &args) | |
Constructor which parses the command-line arguments. | |
~SimulationDecPOMDPDiscrete () | |
Destructor. | |
![]() | |
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. | |
virtual | ~Simulation () |
Destructor. |
Protected Attributes | |
size_t | _m_horizon |
Private Member Functions | |
Index | GetAction (const std::vector< AgentLocalObservations * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI) const |
Index | GetAction (const std::vector< AgentSharedObservations * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI) const |
Index | GetAction (const std::vector< AgentDelayedSharedObservations * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI) const |
Index | GetAction (const std::vector< AgentFullyObservable * > &agents, Index i, Index jaI, Index joI, double r, Index prevJoI, Index sI) const |
void | Initialize () |
double | RunSimulation (const JointPolicyDiscrete *jp) const |
Simulate a run of a discrete joint policy. | |
void | Step (Index jaI, unsigned int t, Index &sI, Index &joI, double &r, double &sumR) const |
Perform one step of the simulation. |
Private Attributes | |
std::string | _m_intermediateResultsFilename |
const PlanningUnitDecPOMDPDiscrete * | _m_pu |
Pointer to the planning unit that generated the policy. | |
bool | _m_saveIntermediateResults |
Additional Inherited Members | |
![]() | |
static const int | illegalRandomSeed = INT_MAX |
SimulationDecPOMDPDiscrete simulates policies in DecPOMDPDiscrete's.
Definition at line 50 of file SimulationDecPOMDPDiscrete.h.
SimulationDecPOMDPDiscrete::SimulationDecPOMDPDiscrete | ( | const PlanningUnitDecPOMDPDiscrete & | pu, |
int | nrRuns, | ||
int | seed = illegalRandomSeed |
||
) |
Constructor specifying the number of runs and the random seed.
Definition at line 42 of file SimulationDecPOMDPDiscrete.cpp.
References Initialize().
SimulationDecPOMDPDiscrete::SimulationDecPOMDPDiscrete | ( | const PlanningUnitDecPOMDPDiscrete & | pu, |
const ArgumentHandlers::Arguments & | args | ||
) |
Constructor which parses the command-line arguments.
Definition at line 52 of file SimulationDecPOMDPDiscrete.cpp.
References Initialize(), Simulation::SetVerbose(), and ArgumentHandlers::Arguments::verbose.
SimulationDecPOMDPDiscrete::~SimulationDecPOMDPDiscrete | ( | ) |
Destructor.
Definition at line 64 of file SimulationDecPOMDPDiscrete.cpp.
|
private |
Definition at line 191 of file SimulationDecPOMDPDiscrete.cpp.
References _m_pu, and PlanningUnitMADPDiscrete::JointToIndividualObservationIndices().
Referenced by RunSimulations().
|
private |
Definition at line 204 of file SimulationDecPOMDPDiscrete.cpp.
|
private |
Definition at line 211 of file SimulationDecPOMDPDiscrete.cpp.
References _m_pu, and PlanningUnitMADPDiscrete::JointToIndividualObservationIndices().
|
private |
Definition at line 225 of file SimulationDecPOMDPDiscrete.cpp.
|
private |
Definition at line 68 of file SimulationDecPOMDPDiscrete.cpp.
References _m_horizon, _m_pu, PlanningUnitDecPOMDPDiscrete::GetDiscount(), PlanningUnit::GetHorizon(), PlanningUnitMADPDiscrete::GetNrJointActions(), Simulation::GetNrRuns(), PlanningUnitMADPDiscrete::GetNrStates(), Simulation::GetRandomSeed(), PlanningUnitDecPOMDPDiscrete::GetReward(), Simulation::GetVerbose(), Simulation::illegalRandomSeed, and Globals::MAXHORIZON.
Referenced by SimulationDecPOMDPDiscrete().
|
private |
Simulate a run of a discrete joint policy.
Definition at line 131 of file SimulationDecPOMDPDiscrete.cpp.
References _m_horizon, _m_pu, PlanningUnitDecPOMDPDiscrete::GetReferred(), PlanningUnitMADPDiscrete::GetSuccessorJOHI(), Simulation::GetVerbose(), Globals::INITIAL_JOHI, MultiAgentDecisionProcessDiscreteInterface::SampleInitialState(), JointPolicyDiscrete::SampleJointAction(), and Step().
Referenced by RunSimulations().
SimulationResult SimulationDecPOMDPDiscrete::RunSimulations | ( | const JointPolicyDiscrete * | jp | ) | const |
Run simulations using a particular discrete joint policy.
Definition at line 109 of file SimulationDecPOMDPDiscrete.cpp.
References _m_horizon, SimulationResult::AddReward(), Simulation::GetNrRuns(), Simulation::GetRandomSeed(), Simulation::GetVerbose(), JointPolicy::Print(), and RunSimulation().
Referenced by DICEPSPlanner::ApproximateEvaluate().
|
inline |
Run simulations using a vector of SimulationAgent.
Definition at line 111 of file SimulationDecPOMDPDiscrete.h.
References _m_horizon, _m_intermediateResultsFilename, _m_pu, _m_saveIntermediateResults, SimulationResult::AddReward(), GetAction(), SimulationResult::GetAvgReward(), Simulation::GetNrRuns(), Simulation::GetRandomSeed(), PlanningUnitDecPOMDPDiscrete::GetReferred(), MultiAgentDecisionProcessDiscreteInterface::GetState(), Simulation::GetVerbose(), PlanningUnitMADPDiscrete::IndividualToJointActionIndices(), MultiAgentDecisionProcessDiscreteInterface::SampleInitialState(), SimulationResult::Save(), NamedDescribedEntity::SoftPrintBrief(), and Step().
void SimulationDecPOMDPDiscrete::SaveIntermediateResults | ( | std::string | filename | ) |
Indicate that intermediate should be stored to file named filename.
Definition at line 102 of file SimulationDecPOMDPDiscrete.cpp.
References _m_intermediateResultsFilename, and _m_saveIntermediateResults.
|
private |
Perform one step of the simulation.
Definition at line 159 of file SimulationDecPOMDPDiscrete.cpp.
References _m_pu, PlanningUnitDecPOMDPDiscrete::GetDiscount(), PlanningUnitMADPDiscrete::GetJointAction(), PlanningUnitMADPDiscrete::GetJointObservation(), MultiAgentDecisionProcessDiscreteInterface::GetObservationProbability(), PlanningUnitDecPOMDPDiscrete::GetReferred(), DecPOMDPDiscreteInterface::GetReward(), MultiAgentDecisionProcessDiscreteInterface::GetState(), MultiAgentDecisionProcessDiscreteInterface::GetTransitionProbability(), Simulation::GetVerbose(), MultiAgentDecisionProcessDiscreteInterface::SampleJointObservation(), MultiAgentDecisionProcessDiscreteInterface::SampleSuccessorState(), and NamedDescribedEntity::SoftPrintBrief().
Referenced by RunSimulation(), and RunSimulations().
|
protected |
Definition at line 88 of file SimulationDecPOMDPDiscrete.h.
Referenced by Initialize(), RunSimulation(), and RunSimulations().
|
private |
Definition at line 59 of file SimulationDecPOMDPDiscrete.h.
Referenced by RunSimulations(), and SaveIntermediateResults().
|
private |
Pointer to the planning unit that generated the policy.
Definition at line 55 of file SimulationDecPOMDPDiscrete.h.
Referenced by GetAction(), Initialize(), RunSimulation(), RunSimulations(), and Step().
|
private |
Definition at line 57 of file SimulationDecPOMDPDiscrete.h.
Referenced by RunSimulations(), and SaveIntermediateResults().