|
MultiAgentDecisionProcess
|
IndividualBeliefJESP stores individual beliefs for the JESP algorithm. More...
#include <IndividualBeliefJESP.h>
Public Member Functions | |
| Index | GetAugmentedStateIndex (Index sI, const std::vector< Index > &oHist_others) const |
| std::vector< Index > | GetOthersObservationHistIndex (Index eI) const |
| Get the vector with others' observation history indices cor.to eI. More... | |
| Index | GetStateIndex (Index eI) const |
| Get the state corresponding to augmented state index eI. More... | |
| IndividualBeliefJESP (Index agentI, Index stage, const PlanningUnitMADPDiscrete &pu) | |
| This constructor usess it arguments to set additional information. More... | |
| IndividualBeliefJESP & | operator= (const IndividualBeliefJESP &o) |
| void | Print () const |
| Prints the belief. More... | |
| std::string | SoftPrint () const |
| Prints the belief. More... | |
| double | Update (const IndividualBeliefJESP &b_prev, Index lastAI, Index newOI, const JointPolicyPureVector *jpol) |
| The individual belief update. More... | |
| ~IndividualBeliefJESP () | |
| Destructor. More... | |
Public Member Functions inherited from Belief | |
| Belief (size_t size=0) | |
| Constructor which sets the size of the belief. More... | |
| Belief (const std::vector< double > &belief) | |
| Constructor which copies belief in this belief. More... | |
| Belief (const BeliefInterface &belief) | |
| Constructor which copies belief in this belief. More... | |
| Belief (const StateDistribution &belief) | |
| void | Clear () |
| Clears the belief. More... | |
| virtual Belief * | Clone () const |
| Returns a pointer to a copy of this class. More... | |
| double | Get (Index sI) const |
| Gets the probability of the sI'th state. More... | |
| std::vector< double > | Get () const |
| Gets a vector of probabilities representing the belief. More... | |
| BeliefIteratorGeneric | GetIterator () const |
| double | InnerProduct (const std::vector< double > &values) const |
| Computes the inner product of a belief with the vector values. More... | |
| std::vector< double > | InnerProduct (const VectorSet &v) const |
| Computes the inner product of a belief with the VectorSet v. More... | |
| std::vector< double > | InnerProduct (const VectorSet &v, const std::vector< bool > &mask) const |
| Computes the inner product of a belief with the VectorSet v. More... | |
| Belief & | operator= (const Belief &o) |
| BeliefInterface & | operator= (const BeliefInterface &o) |
| Copy assignment operator. More... | |
| double & | operator[] (Index &i) |
| Gets the probability of the i'th state. More... | |
| double & | operator[] (int &i) |
| Gets the probability of the i'th state. More... | |
| bool | SanityCheck () const |
| Checks whether the belief is a valid probability distribution. More... | |
| virtual void | Set (const std::vector< double > &belief) |
| Copy the belief into this object. More... | |
| virtual void | Set (Index sI, double prob) |
| Sets probability of the sI'th state to prob . More... | |
| virtual void | Set (const BeliefInterface &belief) |
| Copy the belief into this object. More... | |
| virtual void | Set (const StateDistribution &belief) |
| Copy the belief into this object. More... | |
| unsigned int | Size () const |
| Returns the size of this belief. More... | |
| ~Belief () | |
| Destructor. More... | |
Public Member Functions inherited from BeliefInterface | |
| BeliefInterface () | |
| (default) Constructor More... | |
| virtual | ~BeliefInterface () |
| Destructor. More... | |
Private Attributes | |
| Index | _m_agentI |
| The agent for which this belief is. More... | |
| size_t | _m_nrAgents |
| the number of agents More... | |
| std::vector< size_t > | _m_nrOH_others |
| The number of observation histories of agents != _m_agentI. More... | |
| Scope | _m_others |
| The Scope of the others. More... | |
| const PlanningUnitMADPDiscrete * | _m_pumadp |
| pointer to PlanningUnitMADPDiscrete More... | |
| std::vector< size_t > | _m_sizeVec |
| a vector describing the size of the belief: _m_sizeVec=<nrS,nrJOHothers> More... | |
| Index | _m_stage |
| The time step this belief belongs to. More... | |
| size_t * | _m_stepsizeJOHOH |
| the step-size cache for joHistJ <-> <oHist1,...oHistnrA> conversion More... | |
| size_t * | _m_stepsizeSJOH |
| the step-size cache for eIndex <-> <S, joHistJ> conversion More... | |
Additional Inherited Members | |
Protected Attributes inherited from Belief | |
| StateDistributionVector | _m_b |
| The vector of probability values. More... | |
IndividualBeliefJESP stores individual beliefs for the JESP algorithm.
| IndividualBeliefJESP::IndividualBeliefJESP | ( | Index | agentI, |
| Index | stage, | ||
| const PlanningUnitMADPDiscrete & | pu | ||
| ) |
This constructor usess it arguments to set additional information.
References Belief::_m_b, _m_nrAgents, _m_nrOH_others, _m_others, _m_pumadp, _m_sizeVec, _m_stepsizeJOHOH, _m_stepsizeSJOH, IndexTools::CalculateStepSize(), PlanningUnitMADPDiscrete::GetNrAgents(), PlanningUnitMADPDiscrete::GetNrObservationHistories(), PlanningUnitMADPDiscrete::GetNrStates(), and ArgumentHandlers::size().
| IndividualBeliefJESP::~IndividualBeliefJESP | ( | ) |
Destructor.
References _m_stepsizeJOHOH, and _m_stepsizeSJOH.
Get the vector with others' observation history indices cor.to eI.
References _m_nrAgents, _m_others, _m_pumadp, _m_stage, _m_stepsizeJOHOH, _m_stepsizeSJOH, Globals::CastLIndexToIndex(), and IndexTools::JointToIndividualIndicesStepSize().
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), SoftPrint(), and Update().
Get the state corresponding to augmented state index eI.
References _m_stepsizeSJOH, and IndexTools::JointToIndividualIndicesStepSize().
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), SoftPrint(), and Update().
| IndividualBeliefJESP & IndividualBeliefJESP::operator= | ( | const IndividualBeliefJESP & | o | ) |
References Belief::operator=().
|
inlinevirtual |
Prints the belief.
Reimplemented from Belief.
References SoftPrint().
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively().
|
virtual |
Prints the belief.
Reimplemented from Belief.
References Belief::Get(), GetOthersObservationHistIndex(), GetStateIndex(), Belief::Size(), and PrintTools::SoftPrintVector().
Referenced by Print().
| double IndividualBeliefJESP::Update | ( | const IndividualBeliefJESP & | b_prev, |
| Index | lastAI, | ||
| Index | newOI, | ||
| const JointPolicyPureVector * | jpol | ||
| ) |
The individual belief update.
This gets only an individual action lastAI and individual observation newOI, as its arguments.
References _m_agentI, Belief::_m_b, _m_nrAgents, _m_pumadp, Belief::Get(), JointPolicyPureVector::GetActionIndex(), GetAugmentedStateIndex(), PlanningUnitMADPDiscrete::GetNrAgents(), PlanningUnitMADPDiscrete::GetNrObservations(), PlanningUnitMADPDiscrete::GetNrStates(), PlanningUnitMADPDiscrete::GetObservationProbability(), GetOthersObservationHistIndex(), GetStateIndex(), PlanningUnitMADPDiscrete::GetSuccessorOHI(), PlanningUnitMADPDiscrete::IndividualToJointActionIndices(), PlanningUnitMADPDiscrete::IndividualToJointObservationIndices(), IndexTools::JointToIndividualIndices(), and Belief::Size().
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively().
|
private |
The agent for which this belief is.
Referenced by Update().
|
private |
the number of agents
Referenced by GetOthersObservationHistIndex(), IndividualBeliefJESP(), and Update().
|
private |
The number of observation histories of agents != _m_agentI.
Referenced by IndividualBeliefJESP().
|
private |
The Scope of the others.
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), and IndividualBeliefJESP().
|
private |
pointer to PlanningUnitMADPDiscrete
(might be 0 when this belief is not associated with a PUMADP)
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), IndividualBeliefJESP(), and Update().
|
private |
a vector describing the size of the belief: _m_sizeVec=<nrS,nrJOHothers>
Referenced by IndividualBeliefJESP().
|
private |
The time step this belief belongs to.
Referenced by GetAugmentedStateIndex(), and GetOthersObservationHistIndex().
|
private |
the step-size cache for joHistJ <-> <oHist1,...oHistnrA> conversion
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), IndividualBeliefJESP(), and ~IndividualBeliefJESP().
|
private |
the step-size cache for eIndex <-> <S, joHistJ> conversion
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), GetStateIndex(), IndividualBeliefJESP(), and ~IndividualBeliefJESP().