MultiAgentDecisionProcess
Release 0.2.1
|
Belief represents a probability distribution over the state space. More...
#include <Belief.h>
Public Member Functions | |
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. | |
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. | |
![]() | |
BeliefInterface () | |
(default) Constructor | |
virtual | ~BeliefInterface () |
Destructor. |
Protected Attributes | |
StateDistributionVector | _m_b |
The vector of probability values. |
Friends | |
class | BeliefIterator |
Belief represents a probability distribution over the state space.
It is stored as a full vector.
Belief::Belief | ( | size_t | size | ) |
Constructor which sets the size of the belief.
Definition at line 39 of file Belief.cpp.
Referenced by Clone().
Belief::Belief | ( | const std::vector< double > & | belief | ) |
Constructor which copies belief in this belief.
Definition at line 44 of file Belief.cpp.
Belief::Belief | ( | const BeliefInterface & | belief | ) |
Constructor which copies belief in this belief.
Definition at line 53 of file Belief.cpp.
References BeliefInterface::Get(), and BeliefInterface::Size().
Belief::Belief | ( | const StateDistribution & | belief | ) |
Definition at line 64 of file Belief.cpp.
Belief::~Belief | ( | ) |
Destructor.
Definition at line 71 of file Belief.cpp.
|
virtual |
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements BeliefInterface.
Reimplemented in JointBelief.
Definition at line 117 of file Belief.h.
References Belief().
|
inlinevirtual |
Gets the probability of the sI'th state.
Implements BeliefInterface.
Definition at line 93 of file Belief.h.
References _m_b.
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), and IndividualBeliefJESP::Update().
|
inlinevirtual |
Gets a vector of probabilities representing the belief.
Implements BeliefInterface.
Definition at line 95 of file Belief.h.
References _m_b.
Referenced by IndividualBeliefJESP::SoftPrint().
|
virtual |
Implements BeliefInterface.
Definition at line 217 of file Belief.cpp.
|
virtual |
Computes the inner product of a belief with the vector values.
Implements BeliefInterface.
Definition at line 167 of file Belief.cpp.
|
virtual |
Computes the inner product of a belief with the VectorSet v.
Returns the inner product with each vector in v.
Implements BeliefInterface.
Definition at line 181 of file Belief.cpp.
|
virtual |
Computes the inner product of a belief with the VectorSet v.
Returns the inner product with each vector in v, but only for vectors whose mask is set to true.
Implements BeliefInterface.
Definition at line 197 of file Belief.cpp.
Definition at line 76 of file Belief.cpp.
References _m_b.
|
virtual |
Copy assignment operator.
This must be implemented by the derived class (with this prototype). For an example, see PolicyPoolJPolValPair.
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 BeliefInterface.
Definition at line 85 of file Belief.cpp.
|
inlinevirtual |
Gets the probability of the i'th state.
Implements BeliefInterface.
Definition at line 73 of file Belief.h.
References _m_b.
|
inlinevirtual |
Gets the probability of the i'th state.
Implements BeliefInterface.
Definition at line 77 of file Belief.h.
References _m_b.
|
inlinevirtual |
Prints the belief.
Implements BeliefInterface.
Reimplemented in IndividualBeliefJESP.
Definition at line 101 of file Belief.h.
References SoftPrint().
Referenced by QBG::ComputeRecursivelyNoCache().
|
virtual |
Checks whether the belief is a valid probability distribution.
Implements BeliefInterface.
Definition at line 139 of file Belief.cpp.
References Globals::PROB_PRECISION.
Referenced by JointBelief::Update().
|
virtual |
Copy the belief into this object.
Implements BeliefInterface.
Definition at line 92 of file Belief.cpp.
Referenced by JESPDynamicProgrammingPlanner::DynamicProgrammingBestResponse().
|
inlinevirtual |
Sets probability of the sI'th state to prob .
Implements BeliefInterface.
|
virtual |
Copy the belief into this object.
Implements BeliefInterface.
Definition at line 111 of file Belief.cpp.
References BeliefInterface::Get(), and BeliefInterface::Size().
|
virtual |
Copy the belief into this object.
Implements BeliefInterface.
Definition at line 102 of file Belief.cpp.
References StateDistribution::ToVectorOfDoubles().
|
inlinevirtual |
Returns the size of this belief.
Implements BeliefInterface.
Definition at line 103 of file Belief.h.
References _m_b.
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), IndividualBeliefJESP::SoftPrint(), and IndividualBeliefJESP::Update().
|
virtual |
Prints the belief.
Implements BeliefInterface.
Reimplemented in IndividualBeliefJESP.
Definition at line 130 of file Belief.cpp.
References PrintTools::SoftPrintVector().
Referenced by Print().
|
friend |
|
protected |
The vector of probability values.
Definition at line 52 of file Belief.h.
Referenced by Get(), BeliefIterator::GetProbability(), IndividualBeliefJESP::IndividualBeliefJESP(), BeliefIterator::Next(), operator=(), operator[](), Set(), Size(), JointBelief::Update(), and IndividualBeliefJESP::Update().