MultiAgentDecisionProcess
|
Belief represents a probability distribution over the state space. More...
#include <Belief.h>
Public Member Functions | |
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 Belief * | Clone () 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... | |
Belief & | operator= (const Belief &o) |
BeliefInterface & | operator= (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... | |
void | Print () const |
Prints the belief. 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... | |
std::string | SoftPrint () const |
Prints the belief. More... | |
~Belief () | |
Destructor. More... | |
Public Member Functions inherited from BeliefInterface | |
BeliefInterface () | |
(default) Constructor More... | |
virtual | ~BeliefInterface () |
Destructor. More... | |
Protected Attributes | |
StateDistributionVector | _m_b |
The vector of probability values. More... | |
Friends | |
class | BeliefIterator |
Belief represents a probability distribution over the state space.
It is stored as a full vector.
Belief::Belief | ( | size_t | size = 0 | ) |
Constructor which sets the size of the belief.
Referenced by Clone().
Belief::Belief | ( | const std::vector< double > & | belief | ) |
Constructor which copies belief in this belief.
Belief::Belief | ( | const BeliefInterface & | belief | ) |
Constructor which copies belief in this belief.
References BeliefInterface::Get(), and BeliefInterface::Size().
Belief::Belief | ( | const StateDistribution & | belief | ) |
Belief::~Belief | ( | ) |
Destructor.
|
virtual |
Clears the belief.
Implements BeliefInterface.
|
inlinevirtual |
Returns a pointer to a copy of this class.
Implements BeliefInterface.
Reimplemented in JointBeliefEventDriven, and JointBelief.
References Belief().
|
inlinevirtual |
Gets the probability of the sI'th state.
Implements BeliefInterface.
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), and IndividualBeliefJESP::Update().
|
inlinevirtual |
Gets a vector of probabilities representing the belief.
Implements BeliefInterface.
Referenced by IndividualBeliefJESP::SoftPrint().
|
virtual |
Implements BeliefInterface.
|
virtual |
Computes the inner product of a belief with the vector values.
Implements BeliefInterface.
|
virtual |
Computes the inner product of a belief with the VectorSet v.
Returns the inner product with each vector in v.
Implements BeliefInterface.
|
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.
References _m_b.
Referenced by JointBelief::operator=(), JointBeliefEventDriven::operator=(), and IndividualBeliefJESP::operator=().
|
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.
|
inlinevirtual |
Gets the probability of the i'th state.
Implements BeliefInterface.
|
inlinevirtual |
Gets the probability of the i'th state.
Implements BeliefInterface.
|
inlinevirtual |
Prints the belief.
Implements BeliefInterface.
Reimplemented in IndividualBeliefJESP.
References SoftPrint().
Referenced by QBG::ComputeRecursivelyNoCache().
|
virtual |
Checks whether the belief is a valid probability distribution.
Implements BeliefInterface.
References Globals::PROB_PRECISION.
Referenced by JointBelief::Update(), and JointBeliefEventDriven::Update().
|
virtual |
Copy the belief into this object.
Implements BeliefInterface.
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.
References BeliefInterface::Get(), and BeliefInterface::Size().
|
virtual |
Copy the belief into this object.
Implements BeliefInterface.
References StateDistribution::ToVectorOfDoubles().
|
inlinevirtual |
Returns the size of this belief.
Implements BeliefInterface.
Referenced by JESPDynamicProgrammingPlanner::DPBestResponseRecursively(), IndividualBeliefJESP::SoftPrint(), and IndividualBeliefJESP::Update().
|
virtual |
Prints the belief.
Implements BeliefInterface.
Reimplemented in IndividualBeliefJESP.
References PrintTools::SoftPrintVector().
Referenced by Print().
|
friend |
|
protected |
The vector of probability values.
Referenced by BeliefIterator::GetProbability(), IndividualBeliefJESP::IndividualBeliefJESP(), BeliefIterator::Next(), operator=(), JointBelief::Update(), JointBeliefEventDriven::Update(), and IndividualBeliefJESP::Update().