|
MultiAgentDecisionProcess
|
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. 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 |
SimulationDecPOMDPDiscrete simulates policies in DecPOMDPDiscrete's.
| 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.
|
private |
References _m_pu, and PlanningUnitMADPDiscrete::JointToIndividualObservationIndices().
Referenced by RunSimulations().
|
private |
|
private |
References _m_pu, and PlanningUnitMADPDiscrete::JointToIndividualObservationIndices().
|
private |
|
private |
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().
|
inlineprivate |
Referenced by RunSimulations().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
privatevirtual |
Simulate a run of a discrete joint policy.
Reimplemented in SimulationFactoredDecPOMDPDiscrete.
References _m_horizon, _m_pu, PlanningUnitDecPOMDPDiscrete::GetDPOMDPD(), PlanningUnitMADPDiscrete::GetSuccessorJOHI(), Simulation::GetVerbose(), Globals::INITIAL_JOHI, RunSimulationClusteredBG(), MultiAgentDecisionProcessDiscreteInterface::SampleInitialState(), JointPolicyDiscrete::SampleJointAction(), and Step().
Referenced by RunSimulations().
|
private |
Simulate a run of a JointPolicyPureVectorForClusteredBG.
References _m_horizon, _m_pu, JointPolicyPureVectorForClusteredBG::GetBG(), PlanningUnitDecPOMDPDiscrete::GetDPOMDPD(), PlanningUnitMADPDiscrete::GetNrAgents(), JointPolicyPureVectorForClusteredBG::GetPrevJPPVfCBG(), Simulation::GetVerbose(), PlanningUnitMADPDiscrete::IndividualToJointActionIndices(), Globals::INITIAL_JOHI, PlanningUnitMADPDiscrete::JointToIndividualActionIndices(), PlanningUnitMADPDiscrete::JointToIndividualObservationIndices(), MultiAgentDecisionProcessDiscreteInterface::SampleInitialState(), and Step().
Referenced by RunSimulation().
| SimulationResult SimulationDecPOMDPDiscrete::RunSimulations | ( | const JointPolicyDiscrete * | jp | ) | const |
Run simulations using a particular discrete joint policy.
References _m_horizon, SimulationResult::AddReward(), Simulation::GetNrRuns(), Simulation::GetRandomSeed(), Simulation::GetVerbose(), JointPolicy::Print(), and RunSimulation().
Referenced by DICEPSPlanner::ApproximateEvaluate(), and RunSimulations().
| SimulationResult SimulationDecPOMDPDiscrete::RunSimulations | ( | const boost::shared_ptr< JointPolicyDiscrete > & | jp | ) | const |
Run simulations using a particular discrete joint policy.
References RunSimulations().
|
inline |
Run simulations using a vector of SimulationAgent.
References _m_horizon, SimulationResult::AddReward(), GetAction(), SimulationResult::GetAvgReward(), PlanningUnitDecPOMDPDiscrete::GetDPOMDPD(), Simulation::GetNrRuns(), Simulation::GetRandomSeed(), MultiAgentDecisionProcessDiscreteInterface::GetState(), Simulation::GetVerbose(), PlanningUnitMADPDiscrete::IndividualToJointActionIndices(), PreActHook(), MultiAgentDecisionProcessDiscreteInterface::SampleInitialState(), SimulationResult::Save(), NamedDescribedEntity::SoftPrintBrief(), and Step().
| void SimulationDecPOMDPDiscrete::SaveIntermediateResults | ( | std::string | filename | ) |
Indicate that intermediate should be stored to file named filename.
References _m_intermediateResultsFilename, and _m_saveIntermediateResults.
|
private |
Perform one step of the simulation.
References _m_pu, PlanningUnitDecPOMDPDiscrete::GetDiscount(), PlanningUnitDecPOMDPDiscrete::GetDPOMDPD(), PlanningUnitMADPDiscrete::GetJointAction(), PlanningUnitMADPDiscrete::GetJointObservation(), MultiAgentDecisionProcessDiscreteInterface::GetObservationProbability(), DecPOMDPDiscreteInterface::GetReward(), MultiAgentDecisionProcessDiscreteInterface::GetState(), MultiAgentDecisionProcessDiscreteInterface::GetTransitionProbability(), Simulation::GetVerbose(), MultiAgentDecisionProcessDiscreteInterface::SampleJointObservation(), MultiAgentDecisionProcessDiscreteInterface::SampleSuccessorState(), and NamedDescribedEntity::SoftPrintBrief().
Referenced by RunSimulation(), RunSimulationClusteredBG(), and RunSimulations().
|
protected |
|
protected |
Referenced by SimulationTOIDecPOMDPDiscrete::RunSimulations(), and SaveIntermediateResults().
|
private |
Pointer to the planning unit that generated the policy.
Referenced by GetAction(), Initialize(), RunSimulation(), RunSimulationClusteredBG(), and Step().
|
protected |
Referenced by SimulationTOIDecPOMDPDiscrete::RunSimulations(), and SaveIntermediateResults().