MultiAgentDecisionProcess
|
CPT implements a conditional probability table. More...
#include <CPT.h>
Public Types | |
typedef boost::numeric::ublas::matrix < double > | Matrix |
Public Member Functions | |
virtual CPT * | Clone () const |
Returns a pointer to a copy of this class. More... | |
CPT () | |
Constructor without arguments, needed for serialization. More... | |
CPT (size_t X, size_t Y) | |
Constructor with sizes of sets. More... | |
CPT (const CPT &cpt) | |
Copy constructor. More... | |
double | Get (Index x, Index y) const |
Returns . More... | |
const Matrix * | GetMatrixPtr () const |
Get a pointer to the CPT. More... | |
Index | Sample (Index y) const |
Returns an (index of a) x drawn according to . More... | |
virtual void | SanityCheck () const |
void | Set (Index x, Index y, double prob) |
Sets P(x|y) More... | |
void | SetRandom () |
This will randomize the CPT. More... | |
std::string | SoftPrint () const |
~CPT () | |
Destructor. More... | |
Public Member Functions inherited from CPDDiscreteInterface | |
virtual | ~CPDDiscreteInterface () |
Destructor. More... | |
Protected Member Functions | |
size_t | nrX () const |
size_t | nrY () const |
Private Attributes | |
Matrix | _m_probTable |
CPT implements a conditional probability table.
Uses full matrices.
typedef boost::numeric::ublas::matrix<double> CPT::Matrix |
CPT::CPT | ( | ) |
Constructor without arguments, needed for serialization.
Referenced by Clone().
CPT::CPT | ( | size_t | X, |
size_t | Y | ||
) |
Constructor with sizes of sets.
References _m_probTable.
CPT::CPT | ( | const CPT & | cpt | ) |
Copy constructor.
CPT::~CPT | ( | ) |
Destructor.
References _m_probTable.
|
inlinevirtual |
|
inlineprotected |
Referenced by Sample().
|
inlineprotected |
Returns an (index of a) x drawn according to .
Implements CPDDiscreteInterface.
References _m_probTable, and nrX().
|
virtual |
Implements CPDDiscreteInterface.
References _m_probTable, and Globals::EqualProbability().
Sets P(x|y)
x, y are indices of the 'state': e.g. x is an index to the x-th element in X (the set of values x can take) taken joint action and resulting successor state. prob is the probability. The order of events is s, ja, s', so is the arg. list
Implements CPDDiscreteInterface.
References _m_probTable.
Referenced by FSAOHDist_NECOF::FSAOHDist_NECOF(), and MultiAgentDecisionProcessDiscreteFactoredStates::Initialize2DBN().
void CPT::SetRandom | ( | ) |
This will randomize the CPT.
References _m_probTable.
|
virtual |
Implements CPDDiscreteInterface.
References _m_probTable.
|
private |
Referenced by CPT(), Get(), Sample(), SanityCheck(), Set(), SetRandom(), SoftPrint(), and ~CPT().