MultiAgentDecisionProcess  Release 0.2.1
JointBelief Class Reference

JointBelief stores a joint belief, represented as a regular (dense) vector of doubles. More...

#include <JointBelief.h>

+ Inheritance diagram for JointBelief:
+ Collaboration diagram for JointBelief:

Public Member Functions

virtual JointBeliefClone () const
 Returns a pointer to a copy of this class.
 JointBelief (size_t size=0)
 Constructor which sets the size of the joint belief.
 JointBelief (const std::vector< double > &belief)
 Constructor which copies belief in this joint belief.
 JointBelief (const JointBeliefInterface &belief)
 Constructor which copies belief in this joint belief.
 JointBelief (const StateDistribution &belief)
JointBeliefoperator= (const JointBelief &o)
JointBeliefInterfaceoperator= (const JointBeliefInterface &o)
 assignment operator.
double Update (const MultiAgentDecisionProcessDiscreteInterface &pu, Index lastJAI, Index newJOI)
 Performs a joint belief update on this joint belief.
 ~JointBelief ()
 Destructor.
- Public Member Functions inherited from JointBeliefInterface
 JointBeliefInterface ()
 (default) Constructor
virtual ~JointBeliefInterface ()
 Destructor.
- Public Member Functions inherited from BeliefInterface
 BeliefInterface ()
 (default) Constructor
virtual ~BeliefInterface ()
 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.
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.
void Print () const
 Prints the belief.
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.
std::string SoftPrint () const
 Prints the belief.
 ~Belief ()
 Destructor.

Additional Inherited Members

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

Detailed Description

JointBelief stores a joint belief, represented as a regular (dense) vector of doubles.

Definition at line 45 of file JointBelief.h.

Constructor & Destructor Documentation

JointBelief::JointBelief ( size_t  size = 0)

Constructor which sets the size of the joint belief.

Definition at line 40 of file JointBelief.cpp.

Referenced by Clone().

JointBelief::JointBelief ( const std::vector< double > &  belief)

Constructor which copies belief in this joint belief.

Definition at line 45 of file JointBelief.cpp.

JointBelief::JointBelief ( const JointBeliefInterface belief)

Constructor which copies belief in this joint belief.

Definition at line 50 of file JointBelief.cpp.

JointBelief::JointBelief ( const StateDistribution belief)

Definition at line 54 of file JointBelief.cpp.

JointBelief::~JointBelief ( )

Destructor.

Definition at line 59 of file JointBelief.cpp.

Member Function Documentation

virtual JointBelief* JointBelief::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Reimplemented from Belief.

Definition at line 73 of file JointBelief.h.

References JointBelief().

JointBelief & JointBelief::operator= ( const JointBelief o)

Definition at line 64 of file JointBelief.cpp.

JointBeliefInterface & JointBelief::operator= ( const JointBeliefInterface o)
virtual

assignment operator.

This must be implemented by the derived class (with this prototype).

For now, this function is purely abstract. Might there be some members added to this (base) class, then an implementation could be made. This should then be called using PolicyPoolInterface::operator=(o) from the copy assignment operator of the derived class. See also http://www.icu-project.org/docs/papers/cpp_report/the_assignment_operator_revisited.html .

Implements JointBeliefInterface.

Definition at line 74 of file JointBelief.cpp.

double JointBelief::Update ( const MultiAgentDecisionProcessDiscreteInterface pu,
Index  lastJAI,
Index  newJOI 
)
virtual

Performs a joint belief update on this joint belief.

Performs the belief update. I.e., given the current joint belief b (which is represented by this), we compute P(s'|b, a, o) for all new states s'. This function updates this belief (alter this object). Returned is the normalization factor P(o|b,a), which is also to probability that this new history (belief) occurs given the previous one.

Implements JointBeliefInterface.

Definition at line 95 of file JointBelief.cpp.

References Belief::_m_b, TGet::Get(), MultiAgentDecisionProcessDiscreteInterface::GetNrStates(), MultiAgentDecisionProcessDiscreteInterface::GetObservationProbability(), MultiAgentDecisionProcessDiscreteInterface::GetTGet(), MultiAgentDecisionProcessDiscreteInterface::GetTransitionProbability(), and Belief::SanityCheck().

Referenced by QBG::ComputeRecursivelyNoCache().


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