40 #ifndef GUM_STRUCTURED_BB_H 41 # define GUM_STRUCTURED_BB_H 50 template <
typename GUM_SCALAR >
125 std::pair< bool, bool >&
__getMark(InstanceMap& marks,
162 HashTable< const PRMInstance< GUM_SCALAR >*,
163 std::pair< std::string, Set< NodeId >* > >
172 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS <agrum/PRM/structuredBayesBall.h>
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const Set< NodeId > & requisiteNodes(const PRMInstance< GUM_SCALAR > *i) const
Returns the set of requisite nodes w.r.t. d-separation for i.
An PRMInstance is a Bayesian Network fragment defined by a Class and used in a PRMSystem.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::pair< bool, bool > & __getMark(InstanceMap &marks, const PRMInstance< GUM_SCALAR > *i, NodeId n)
Code alias.
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...
bool __isHardEvidence(const PRMInstance< GUM_SCALAR > *i, NodeId n)
Returns true if there is a hard evidence on i->get(n).
~StructuredBayesBall()
Destructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTable< const PRMInstance< GUM_SCALAR > *, std::pair< std::string, Set< NodeId > *> > __keyMap
Associate an PRMInstance<GUM_SCALAR> with a unique key w.r.t. d-separation and the set of requisite n...
The class for generic Hash Tables.
HashTable< std::string, std::pair< Set< NodeId > *, Size > > __reqMap
Associate a Key with the set of requisite nodes associated with it. The Size value is the number of i...
void __fillMaps(InstanceMap &marks)
Fill __keyMap and __reqMap.
bool exists(const PRMInstance< GUM_SCALAR > *i) const
Returns true if i has requisite nodes.
HashTable< NodeId, std::pair< bool, bool > > MarkMap
Code alias.
void __fromChild(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is received on i->get(n) from a child.
Size occurrence(const std::string &key) const
Returns the number of occurrence of the given key, which is the number of PRMInstance<GUM_SCALAR> sha...
StructuredBayesBall & operator=(const StructuredBayesBall &source)
Copy operator.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::string __buildHashKey(const PRMInstance< GUM_SCALAR > *i, Set< NodeId > &req_nodes)
Builds the HashKey for the given instance and requisite nodes set.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
const std::string & key(const PRMInstance< GUM_SCALAR > *i) const
Returns a unique key w.r.t. d-separation for i.
void __clean()
Cleans this before a new computation.
const PRMSlotChain< GUM_SCALAR > & __getSC(const PRMInstance< GUM_SCALAR > *i, NodeId n)
Code alias.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
This abstract class is used as base class for all inference class on PRM<GUM_SCALAR>.
StructuredBayesBall(const PRMInference< GUM_SCALAR > &inference)
Default Constructor.
const PRMInference< GUM_SCALAR > * __inf
The PRM at which __model belongs.
void __compute(const PRMInstance< GUM_SCALAR > *i, NodeId n)
The real compute method.
HashTable< const PRMInstance< GUM_SCALAR > *, MarkMap *> InstanceMap
Code alias.
float liftRatio() const
Returns the ratio between the total number of instances and the number of instances with the same con...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
void __fromParent(const PRMInstance< GUM_SCALAR > *i, NodeId n, InstanceMap &marks)
When the ball is receive on i->get(n) from a parent.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size NodeId
Type for node ids.