MultiAgentDecisionProcess  Release 0.2.1
IndividualBeliefJESP Class Reference

IndividualBeliefJESP stores individual beliefs for the JESP algorithm. More...

#include <IndividualBeliefJESP.h>

+ Inheritance diagram for IndividualBeliefJESP:
+ Collaboration diagram for IndividualBeliefJESP:

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.
IndividualBeliefJESPoperator= (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.
- Public Member Functions inherited from Belief
 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 BeliefClone () 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.
Beliefoperator= (const Belief &o)
BeliefInterfaceoperator= (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.
- Public Member Functions inherited from BeliefInterface
 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

- Protected Attributes inherited from Belief
StateDistributionVector _m_b
 The vector of probability values.

Detailed Description

IndividualBeliefJESP stores individual beliefs for the JESP algorithm.

Definition at line 46 of file IndividualBeliefJESP.h.

Constructor & Destructor Documentation

IndividualBeliefJESP::IndividualBeliefJESP ( Index  agentI,
Index  stage,
const PlanningUnitMADPDiscrete pu 
)
IndividualBeliefJESP::~IndividualBeliefJESP ( )

Destructor.

Definition at line 82 of file IndividualBeliefJESP.cpp.

References _m_stepsizeJOHOH, and _m_stepsizeSJOH.

Member Function Documentation

Index IndividualBeliefJESP::GetAugmentedStateIndex ( Index  sI,
const std::vector< Index > &  oHist_others 
) const
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().

Index IndividualBeliefJESP::GetStateIndex ( Index  eI) const
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.

void IndividualBeliefJESP::Print ( ) const
inlinevirtual

Prints the belief.

Reimplemented from Belief.

Definition at line 105 of file IndividualBeliefJESP.h.

References SoftPrint().

Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively().

string IndividualBeliefJESP::SoftPrint ( ) const
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().

Member Data Documentation

Index IndividualBeliefJESP::_m_agentI
private

The agent for which this belief is.

Definition at line 59 of file IndividualBeliefJESP.h.

Referenced by Update().

size_t IndividualBeliefJESP::_m_nrAgents
private

the number of agents

Definition at line 57 of file IndividualBeliefJESP.h.

Referenced by GetOthersObservationHistIndex(), IndividualBeliefJESP(), and Update().

std::vector<size_t> IndividualBeliefJESP::_m_nrOH_others
private

The number of observation histories of agents != _m_agentI.

Definition at line 63 of file IndividualBeliefJESP.h.

Referenced by IndividualBeliefJESP().

std::vector<Index> IndividualBeliefJESP::_m_others
private

The scope of the others.

Definition at line 61 of file IndividualBeliefJESP.h.

Referenced by GetAugmentedStateIndex(), GetOthersObservationHistIndex(), and IndividualBeliefJESP().

const PlanningUnitMADPDiscrete* IndividualBeliefJESP::_m_pumadp
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().

std::vector<size_t> IndividualBeliefJESP::_m_sizeVec
private

a vector describing the size of the belief: _m_sizeVec=<nrS,nrJOHothers>

Definition at line 65 of file IndividualBeliefJESP.h.

Referenced by IndividualBeliefJESP().

Index IndividualBeliefJESP::_m_stage
private

The time step this belief belongs to.

Definition at line 55 of file IndividualBeliefJESP.h.

Referenced by GetAugmentedStateIndex(), and GetOthersObservationHistIndex().

size_t* IndividualBeliefJESP::_m_stepsizeJOHOH
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().

size_t* IndividualBeliefJESP::_m_stepsizeSJOH
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().


The documentation for this class was generated from the following files: