![]() |
aGrUM
0.21.0
a C++ library for (probabilistic) graphical models
|
<agrum/PRM/structuredBayesBall.h> More...
#include <structuredBayesBall.h>
Public Member Functions | |
void | compute (const PRMInstance< GUM_SCALAR > *i, NodeId n) |
Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations. More... | |
void | compute (const PRMInstance< GUM_SCALAR > &i, NodeId n) |
Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations. More... | |
bool | _isHardEvidence_ (const PRMInstance< GUM_SCALAR > *i, NodeId n) |
Returns true if there is a hard evidence on i->get(n). More... | |
Constructors & destructor. | |
StructuredBayesBall (const PRMInference< GUM_SCALAR > &inference) | |
Default Constructor. More... | |
~StructuredBayesBall () | |
Destructor. More... | |
Getters and Setters. | |
const std::string & | key (const PRMInstance< GUM_SCALAR > *i) const |
Returns a unique key w.r.t. d-separation for i. More... | |
const std::string & | key (const PRMInstance< GUM_SCALAR > &i) const |
Returns a unique key w.r.t. d-separation for i. More... | |
const Set< NodeId > & | requisiteNodes (const PRMInstance< GUM_SCALAR > *i) const |
Returns the set of requisite nodes w.r.t. d-separation for i. More... | |
const Set< NodeId > & | requisiteNodes (const PRMInstance< GUM_SCALAR > &i) const |
Returns the set of requisite nodes w.r.t. d-separation for i. More... | |
Size | occurrence (const std::string &key) const |
Returns the number of occurrence of the given key, which is the number of PRMInstance<GUM_SCALAR> sharing the same set of requisite nodes. More... | |
float | liftRatio () const |
Returns the ratio between the total number of instances and the number of instances with the same configuration. More... | |
bool | exists (const PRMInstance< GUM_SCALAR > *i) const |
Returns true if i has requisite nodes. More... | |
bool | exists (const PRMInstance< GUM_SCALAR > &i) const |
Returns true if i has requisite nodes. More... | |
<agrum/PRM/structuredBayesBall.h>
This class represent the BayesBall algorithm applied on PRMs.
Definition at line 50 of file structuredBayesBall.h.
|
private |
Code alias.
Definition at line 120 of file structuredBayesBall.h.
|
private |
Code alias.
Definition at line 118 of file structuredBayesBall.h.
INLINE gum::prm::StructuredBayesBall< GUM_SCALAR >::StructuredBayesBall | ( | const PRMInference< GUM_SCALAR > & | inference | ) |
Default Constructor.
Definition at line 246 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
gum::prm::StructuredBayesBall< GUM_SCALAR >::~StructuredBayesBall | ( | ) |
Destructor.
Definition at line 35 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Copy constructor.
|
private |
Builds the HashKey for the given instance and requisite nodes set.
Definition at line 234 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Cleans this before a new computation.
Definition at line 43 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
The real compute method.
Definition at line 77 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Fill keyMap and reqMap.
Definition at line 191 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
When the ball is received on i->get(n) from a child.
Definition at line 91 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
When the ball is receive on i->get(n) from a parent.
Definition at line 160 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Code alias.
Definition at line 332 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Code alias.
Definition at line 326 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
bool gum::prm::StructuredBayesBall< GUM_SCALAR >::_isHardEvidence_ | ( | const PRMInstance< GUM_SCALAR > * | i, |
NodeId | n | ||
) |
Returns true if there is a hard evidence on i->get(n).
Definition at line 52 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE void gum::prm::StructuredBayesBall< GUM_SCALAR >::compute | ( | const PRMInstance< GUM_SCALAR > * | i, |
NodeId | n | ||
) |
Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations.
Definition at line 313 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE void gum::prm::StructuredBayesBall< GUM_SCALAR >::compute | ( | const PRMInstance< GUM_SCALAR > & | i, |
NodeId | n | ||
) |
Compute the set or requisite nodes for each required instance given the current set of observations. Discard previous computations.
Definition at line 319 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE bool gum::prm::StructuredBayesBall< GUM_SCALAR >::exists | ( | const PRMInstance< GUM_SCALAR > * | i | ) | const |
Returns true if i has requisite nodes.
Definition at line 302 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE bool gum::prm::StructuredBayesBall< GUM_SCALAR >::exists | ( | const PRMInstance< GUM_SCALAR > & | i | ) | const |
Returns true if i has requisite nodes.
Definition at line 308 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE const std::string & gum::prm::StructuredBayesBall< GUM_SCALAR >::key | ( | const PRMInstance< GUM_SCALAR > * | i | ) | const |
Returns a unique key w.r.t. d-separation for i.
Definition at line 268 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE const std::string & gum::prm::StructuredBayesBall< GUM_SCALAR >::key | ( | const PRMInstance< GUM_SCALAR > & | i | ) | const |
Returns a unique key w.r.t. d-separation for i.
Definition at line 274 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE float gum::prm::StructuredBayesBall< GUM_SCALAR >::liftRatio | ( | ) | const |
Returns the ratio between the total number of instances and the number of instances with the same configuration.
Definition at line 296 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE Size gum::prm::StructuredBayesBall< GUM_SCALAR >::occurrence | ( | const std::string & | key | ) | const |
Returns the number of occurrence of the given key, which is the number of PRMInstance<GUM_SCALAR> sharing the same set of requisite nodes.
Definition at line 291 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Copy operator.
Definition at line 261 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE const Set< NodeId > & gum::prm::StructuredBayesBall< GUM_SCALAR >::requisiteNodes | ( | const PRMInstance< GUM_SCALAR > * | i | ) | const |
Returns the set of requisite nodes w.r.t. d-separation for i.
Definition at line 280 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE const Set< NodeId > & gum::prm::StructuredBayesBall< GUM_SCALAR >::requisiteNodes | ( | const PRMInstance< GUM_SCALAR > & | i | ) | const |
Returns the set of requisite nodes w.r.t. d-separation for i.
Definition at line 286 of file structuredBayesBall_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
The PRM at which model belongs.
Definition at line 146 of file structuredBayesBall.h.
|
private |
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite nodes deduced from d-separation analysis.
Definition at line 153 of file structuredBayesBall.h.
|
private |
Associate a Key with the set of requisite nodes associated with it. The Size value is the number of instance with the same key.
Definition at line 157 of file structuredBayesBall.h.