![]() |
aGrUM
0.16.0
|
<agrum/FMDP/learning/datastructure/nodeDatabase.h> More...
#include <nodeDatabase.h>
Public Member Functions | |
Idx | effectif (Idx moda) const |
Idx | valueDomain () const |
Constructor & destructor. | |
NodeDatabase (const Set< const DiscreteVariable * > *, const DiscreteVariable *=nullptr) | |
Default constructor. More... | |
~NodeDatabase () | |
Default destructor. More... | |
void * | operator new (size_t s) |
Allocators and Deallocators redefinition. More... | |
void | operator delete (void *p) |
Default constructor. More... | |
Variable Test Methods | |
INLINE bool | isTestRelevant (const DiscreteVariable *var) const |
Indicates wether or not, node has sufficient observation so that any statistic is relevant. More... | |
INLINE double | testValue (const DiscreteVariable *var) const |
Returns the performance of given variables according to selection criterion. More... | |
INLINE double | testOtherCriterion (const DiscreteVariable *var) const |
Returns the performance of given variables according to selection secondary criterion (to break ties) More... | |
Aggregation Methods | |
NodeDatabase< AttributeSelection, isScalar > & | operator+= (const NodeDatabase< AttributeSelection, isScalar > &src) |
Merges given NodeDatabase informations into current nDB. More... | |
const TestPolicy< ValueType > * | testPolicy (const DiscreteVariable *var) const |
Returns a reference to nDB test policy for given variable (so that test policy information can be merged too) More... | |
const HashTableConstIteratorSafe< ValueType, Idx > | cbeginValues () const |
Iterators on value count to recopy correctly its content. More... | |
const HashTableConstIteratorSafe< ValueType, Idx > | cendValues () const |
Merges given NodeDatabase informations into current nDB. More... | |
Observation handling methods | |
void | addObservation (const Observation *) |
Nb observation taken into account by this instance. More... | |
INLINE Idx | nbObservation () const |
Nb observation taken into account by this instance. More... | |
void | __addObservation (const Observation *, Int2Type< true >) |
Updates database with new observation. More... | |
void | __addObservation (const Observation *, Int2Type< false >) |
depending on if we're learning reward function or transition probability More... | |
<agrum/FMDP/learning/datastructure/nodeDatabase.h>
Definition at line 58 of file nodeDatabase.h.
|
private |
Definition at line 66 of file nodeDatabase.h.
|
private |
Definition at line 59 of file nodeDatabase.h.
gum::NodeDatabase< AttributeSelection, isScalar >::NodeDatabase | ( | const Set< const DiscreteVariable * > * | attrSet, |
const DiscreteVariable * | value = nullptr |
||
) |
Default constructor.
Definition at line 43 of file nodeDatabase_tpl.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable, gum::NodeDatabase< AttributeSelection, isScalar >::__nbObservation, gum::Set< Key, Alloc >::cbeginSafe(), and gum::Set< Key, Alloc >::cendSafe().
gum::NodeDatabase< AttributeSelection, isScalar >::~NodeDatabase | ( | ) |
Default destructor.
Definition at line 63 of file nodeDatabase_tpl.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable.
|
private |
Updates database with new observation.
Calls either or
Definition at line 92 of file nodeDatabase_tpl.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable, gum::NodeDatabase< AttributeSelection, isScalar >::__valueCount, gum::Observation::reward(), and gum::Observation::rModality().
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::addObservation(), and gum::NodeDatabase< AttributeSelection, isScalar >::operator delete().
|
private |
depending on if we're learning reward function or transition probability
Definition at line 107 of file nodeDatabase_tpl.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable, gum::NodeDatabase< AttributeSelection, isScalar >::__value, gum::NodeDatabase< AttributeSelection, isScalar >::__valueCount, gum::Observation::modality(), and gum::NodeDatabase< AttributeSelection, isScalar >::operator+=().
|
inlineprivate |
Definition at line 198 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__valueCount.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::valueDomain().
|
inlineprivate |
Definition at line 199 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__value, gum::DiscreteVariable::domainSize(), and gum::NodeDatabase< AttributeSelection, isScalar >::toString().
void gum::NodeDatabase< AttributeSelection, isScalar >::addObservation | ( | const Observation * | newObs | ) |
Nb observation taken into account by this instance.
Definition at line 85 of file nodeDatabase_tpl.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__addObservation(), and gum::NodeDatabase< AttributeSelection, isScalar >::__nbObservation.
Referenced by gum::IncrementalGraphLearner< AttributeSelection, isScalar >::_transpose(), and gum::NodeDatabase< AttributeSelection, isScalar >::operator delete().
|
inline |
Iterators on value count to recopy correctly its content.
Definition at line 177 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__valueCount.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::operator+=().
|
inline |
Merges given NodeDatabase informations into current nDB.
Definition at line 180 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__valueCount.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::operator+=().
|
inline |
Definition at line 190 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__valueCount.
|
inline |
Indicates wether or not, node has sufficient observation so that any statistic is relevant.
Definition at line 133 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable.
|
inline |
Nb observation taken into account by this instance.
Definition at line 120 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__nbObservation.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::operator+=(), and gum::NodeDatabase< AttributeSelection, isScalar >::toString().
|
inline |
Default constructor.
Definition at line 91 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__addObservation(), gum::NodeDatabase< AttributeSelection, isScalar >::addObservation(), gum::SmallObjectAllocator::deallocate(), and gum::SmallObjectAllocator::instance().
|
inline |
Allocators and Deallocators redefinition.
Definition at line 88 of file nodeDatabase.h.
References gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().
NodeDatabase< AttributeSelection, isScalar > & gum::NodeDatabase< AttributeSelection, isScalar >::operator+= | ( | const NodeDatabase< AttributeSelection, isScalar > & | src | ) |
Merges given NodeDatabase informations into current nDB.
Definition at line 133 of file nodeDatabase_tpl.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable, gum::NodeDatabase< AttributeSelection, isScalar >::__nbObservation, gum::NodeDatabase< AttributeSelection, isScalar >::__valueCount, gum::NodeDatabase< AttributeSelection, isScalar >::cbeginValues(), gum::NodeDatabase< AttributeSelection, isScalar >::cendValues(), gum::NodeDatabase< AttributeSelection, isScalar >::nbObservation(), and gum::NodeDatabase< AttributeSelection, isScalar >::testPolicy().
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::__addObservation(), and gum::NodeDatabase< AttributeSelection, isScalar >::testOtherCriterion().
|
inline |
Returns the performance of given variables according to selection secondary criterion (to break ties)
Definition at line 149 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable, and gum::NodeDatabase< AttributeSelection, isScalar >::operator+=().
|
inline |
Returns a reference to nDB test policy for given variable (so that test policy information can be merged too)
Definition at line 170 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::operator+=().
|
inline |
Returns the performance of given variables according to selection criterion.
Definition at line 141 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable.
|
private |
Definition at line 151 of file nodeDatabase_tpl.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__attrTable, and gum::NodeDatabase< AttributeSelection, isScalar >::nbObservation().
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::__valueDomain().
|
inline |
Definition at line 195 of file nodeDatabase.h.
References gum::NodeDatabase< AttributeSelection, isScalar >::__valueDomain().
|
private |
Table giving for every variables its instantiation.
Definition at line 205 of file nodeDatabase.h.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::__addObservation(), gum::NodeDatabase< AttributeSelection, isScalar >::isTestRelevant(), gum::NodeDatabase< AttributeSelection, isScalar >::NodeDatabase(), gum::NodeDatabase< AttributeSelection, isScalar >::operator+=(), gum::NodeDatabase< AttributeSelection, isScalar >::testOtherCriterion(), gum::NodeDatabase< AttributeSelection, isScalar >::testPolicy(), gum::NodeDatabase< AttributeSelection, isScalar >::testValue(), gum::NodeDatabase< AttributeSelection, isScalar >::toString(), and gum::NodeDatabase< AttributeSelection, isScalar >::~NodeDatabase().
|
private |
Definition at line 211 of file nodeDatabase.h.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::addObservation(), gum::NodeDatabase< AttributeSelection, isScalar >::nbObservation(), gum::NodeDatabase< AttributeSelection, isScalar >::NodeDatabase(), and gum::NodeDatabase< AttributeSelection, isScalar >::operator+=().
|
private |
So does this reference on the value observed.
Definition at line 208 of file nodeDatabase.h.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::__addObservation(), and gum::NodeDatabase< AttributeSelection, isScalar >::__valueDomain().
|
private |
Definition at line 214 of file nodeDatabase.h.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::__addObservation(), gum::NodeDatabase< AttributeSelection, isScalar >::__valueDomain(), gum::NodeDatabase< AttributeSelection, isScalar >::cbeginValues(), gum::NodeDatabase< AttributeSelection, isScalar >::cendValues(), gum::NodeDatabase< AttributeSelection, isScalar >::effectif(), and gum::NodeDatabase< AttributeSelection, isScalar >::operator+=().