MultiAgentDecisionProcess
Release 0.2.1
|
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. | |
Index | GetStateIndex (Index eI) const |
Get the state corresponding to augmented state index eI. | |
IndividualBeliefJESP (Index agentI, Index stage, const PlanningUnitMADPDiscrete &pu) | |
This constructor usess it arguments to set additional information. | |
IndividualBeliefJESP & | operator= (const IndividualBeliefJESP &o) |
void | Print () const |
Prints the belief. | |
std::string | SoftPrint () const |
Prints the belief. | |
double | Update (const IndividualBeliefJESP &b_prev, Index lastAI, Index newOI, const JointPolicyPureVector *jpol) |
The individual belief update. | |
~IndividualBeliefJESP () | |
Destructor. | |
![]() | |
Belief (size_t size) | |
Constructor which sets the size of the belief. | |
Belief (const std::vector< double > &belief) | |
Constructor which copies belief in this belief. | |
Belief (const BeliefInterface &belief) | |
Constructor which copies belief in this belief. | |
Belief (const StateDistribution &belief) | |
void | Clear () |
Clears the belief. | |
virtual Belief * | Clone () const |
Returns a pointer to a copy of this class. | |
double | Get (Index sI) const |
Gets the probability of the sI'th state. | |
std::vector< double > | Get () const |
Gets a vector of probabilities representing the belief. | |
BeliefIteratorGeneric | GetIterator () const |
double | InnerProduct (const std::vector< double > &values) const |
Computes the inner product of a belief with the vector values. | |
std::vector< double > | InnerProduct (const VectorSet &v) const |
Computes the inner product of a belief with the VectorSet v. | |
std::vector< double > | InnerProduct (const VectorSet &v, const std::vector< bool > &mask) const |
Computes the inner product of a belief with the VectorSet v. | |
Belief & | operator= (const Belief &o) |
BeliefInterface & | operator= (const BeliefInterface &o) |
Copy assignment operator. | |
double & | operator[] (Index &i) |
Gets the probability of the i'th state. | |
double & | operator[] (int &i) |
Gets the probability of the i'th state. | |
bool | SanityCheck () const |
Checks whether the belief is a valid probability distribution. | |
virtual void | Set (const std::vector< double > &belief) |
Copy the belief into this object. | |
virtual void | Set (Index sI, double prob) |
Sets probability of the sI'th state to prob . | |
virtual void | Set (const BeliefInterface &belief) |
Copy the belief into this object. | |
virtual void | Set (const StateDistribution &belief) |
Copy the belief into this object. | |
unsigned int | Size () const |
Returns the size of this belief. | |
~Belief () | |
Destructor. | |
![]() | |
BeliefInterface () | |
(default) Constructor | |
virtual | ~BeliefInterface () |
Destructor. |
Private Attributes | |
Index | _m_agentI |
The agent for which this belief is. | |
size_t | _m_nrAgents |
the number of agents | |
std::vector< size_t > | _m_nrOH_others |
The number of observation histories of agents != _m_agentI. | |
std::vector< Index > | _m_others |
The scope of the others. | |
const PlanningUnitMADPDiscrete * | _m_pumadp |
pointer to PlanningUnitMADPDiscrete | |
std::vector< size_t > | _m_sizeVec |
a vector describing the size of the belief: _m_sizeVec=<nrS,nrJOHothers> | |
Index | _m_stage |
The time step this belief belongs to. | |
size_t * | _m_stepsizeJOHOH |
the step-size cache for joHistJ <-> <oHist1,...oHistnrA> conversion | |
size_t * | _m_stepsizeSJOH |
the step-size cache for eIndex <-> <S, joHistJ> conversion |
Additional Inherited Members | |
![]() | |
StateDistributionVector | _m_b |
The vector of probability values. |
IndividualBeliefJESP stores individual beliefs for the JESP algorithm.
Definition at line 46 of file IndividualBeliefJESP.h.
IndividualBeliefJESP::IndividualBeliefJESP | ( | Index | agentI, |
Index | stage, | ||
const PlanningUnitMADPDiscrete & | pu | ||
) |
This constructor usess it arguments to set additional information.
Definition at line 40 of file IndividualBeliefJESP.cpp.
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(), and PlanningUnitMADPDiscrete::GetNrStates().
IndividualBeliefJESP::~IndividualBeliefJESP | ( | ) |
Destructor.
Definition at line 82 of file IndividualBeliefJESP.cpp.
References _m_stepsizeJOHOH, and _m_stepsizeSJOH.
Index IndividualBeliefJESP::GetAugmentedStateIndex | ( | Index | sI, |
const std::vector< Index > & | oHist_others | ||
) | const |
Definition at line 117 of file IndividualBeliefJESP.cpp.
References _m_others, _m_pumadp, _m_stage, _m_stepsizeJOHOH, _m_stepsizeSJOH, and IndexTools::IndividualToJointIndicesStepSize().
Referenced by Update().
vector< Index > IndividualBeliefJESP::GetOthersObservationHistIndex | ( | Index | eI | ) | const |
Get the vector with others' observation history indices cor.to eI.
Definition at line 101 of file IndividualBeliefJESP.cpp.
References _m_nrAgents, _m_others, _m_pumadp, _m_stage, _m_stepsizeJOHOH, _m_stepsizeSJOH, and IndexTools::JointToIndividualIndicesStepSize().
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), SoftPrint(), and Update().
|
inline |
Get the state corresponding to augmented state index eI.
Definition at line 112 of file IndividualBeliefJESP.h.
References _m_stepsizeSJOH, and IndexTools::JointToIndividualIndicesStepSize().
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), SoftPrint(), and Update().
IndividualBeliefJESP & IndividualBeliefJESP::operator= | ( | const IndividualBeliefJESP & | o | ) |
Definition at line 89 of file IndividualBeliefJESP.cpp.
|
inlinevirtual |
Prints the belief.
Reimplemented from Belief.
Definition at line 105 of file IndividualBeliefJESP.h.
References SoftPrint().
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively().
|
virtual |
Prints the belief.
Reimplemented from Belief.
Definition at line 231 of file IndividualBeliefJESP.cpp.
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.
Definition at line 135 of file IndividualBeliefJESP.cpp.
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.
Definition at line 59 of file IndividualBeliefJESP.h.
Referenced by Update().
|
private |
the number of agents
Definition at line 57 of file IndividualBeliefJESP.h.
Referenced by GetOthersObservationHistIndex(), IndividualBeliefJESP(), and Update().
|
private |
The number of observation histories of agents != _m_agentI.
Definition at line 63 of file IndividualBeliefJESP.h.
Referenced by IndividualBeliefJESP().
|
private |
The scope of the others.
Definition at line 61 of file IndividualBeliefJESP.h.
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), and IndividualBeliefJESP().
|
private |
pointer to PlanningUnitMADPDiscrete
(might be 0 when this belief is not associated with a PUMADP)
Definition at line 53 of file IndividualBeliefJESP.h.
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), IndividualBeliefJESP(), and Update().
|
private |
a vector describing the size of the belief: _m_sizeVec=<nrS,nrJOHothers>
Definition at line 65 of file IndividualBeliefJESP.h.
Referenced by IndividualBeliefJESP().
|
private |
The time step this belief belongs to.
Definition at line 55 of file IndividualBeliefJESP.h.
Referenced by GetAugmentedStateIndex(), and GetOthersObservationHistIndex().
|
private |
the step-size cache for joHistJ <-> <oHist1,...oHistnrA> conversion
Definition at line 69 of file IndividualBeliefJESP.h.
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), IndividualBeliefJESP(), and ~IndividualBeliefJESP().
|
private |
the step-size cache for eIndex <-> <S, joHistJ> conversion
Definition at line 67 of file IndividualBeliefJESP.h.
Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), GetStateIndex(), IndividualBeliefJESP(), and ~IndividualBeliefJESP().