MultiAgentDecisionProcess
IndividualBeliefJESP Class Reference

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

#include <IndividualBeliefJESP.h>

Inheritance diagram for IndividualBeliefJESP:
[legend]

Public Member Functions

Index GetAugmentedStateIndex (Index sI, const std::vector< Index > &oHist_others) const
 
std::vector< IndexGetOthersObservationHistIndex (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...
 
IndividualBeliefJESPoperator= (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 BeliefClone () 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...
 
Beliefoperator= (const Belief &o)
 
BeliefInterfaceoperator= (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...
 

Detailed Description

IndividualBeliefJESP stores individual beliefs for the JESP algorithm.

Constructor & Destructor Documentation

IndividualBeliefJESP::~IndividualBeliefJESP ( )

Destructor.

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

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=().

void IndividualBeliefJESP::Print ( ) const
inlinevirtual

Prints the belief.

Reimplemented from Belief.

References SoftPrint().

Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively().

string IndividualBeliefJESP::SoftPrint ( ) const
virtual

Prints the belief.

Reimplemented from Belief.

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.

Referenced by Update().

size_t IndividualBeliefJESP::_m_nrAgents
private

the number of agents

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

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

The number of observation histories of agents != _m_agentI.

Referenced by IndividualBeliefJESP().

Scope IndividualBeliefJESP::_m_others
private
const PlanningUnitMADPDiscrete* IndividualBeliefJESP::_m_pumadp
private

pointer to PlanningUnitMADPDiscrete

(might be 0 when this belief is not associated with a PUMADP)

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>

Referenced by IndividualBeliefJESP().

Index IndividualBeliefJESP::_m_stage
private

The time step this belief belongs to.

Referenced by GetAugmentedStateIndex(), and GetOthersObservationHistIndex().

size_t* IndividualBeliefJESP::_m_stepsizeJOHOH
private

the step-size cache for joHistJ <-> <oHist1,...oHistnrA> conversion

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

size_t* IndividualBeliefJESP::_m_stepsizeSJOH
private

the step-size cache for eIndex <-> <S, joHistJ> conversion

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