![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
#include <agrum/FMDP/planning/FunctionGraph/imddi.h>
Public Member Functions | |
void | insertSetOfVars (MultiDimFunctionGraph< double > *ret) const |
Size | size () |
Constructor & destructor. | |
IMDDI (MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, double pairSelectionThreshold, Set< const DiscreteVariable * > attributeListe, const DiscreteVariable *learnedValue) | |
Variable Learner constructor. More... | |
IMDDI (MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, double pairSelectionThreshold, Set< const DiscreteVariable * > attributeListe) | |
Reward Learner constructor. More... | |
~IMDDI () | |
Default destructor. More... | |
Visit Methods | |
NodeId | root () const |
bool | isTerminal (NodeId ni) const |
const DiscreteVariable * | nodeVar (NodeId ni) const |
NodeId | nodeSon (NodeId ni, Idx modality) const |
Idx | nodeNbObservation (NodeId ni) const |
Protected Attributes | |
MultiDimFunctionGraph< double > * | target_ |
The final diagram we're building. More... | |
Set< const DiscreteVariable *> | setOfVars_ |
const DiscreteVariable * | value_ |
Sequence< ValueType > | valueAssumed_ |
bool | needUpdate_ |
Model handling datastructures | |
NodeGraphPart | model_ |
The source of nodeId. More... | |
NodeId | root_ |
The root of the ordered tree. More... | |
HashTable< NodeId, const DiscreteVariable *> | nodeVarMap_ |
Gives for any node its associated variable. More... | |
HashTable< NodeId, NodeId *> | nodeSonsMap_ |
A table giving for any node a table mapping to its son idx is the modality of associated variable. More... | |
HashTable< const DiscreteVariable *, LinkedList< NodeId > *> | var2Node_ |
Associates to any variable the list of all nodes associated to this variable. More... | |
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar > *> | nodeId2Database_ |
This hashtable binds every node to an associated NodeDatabase which handles every observation that concerns that node. More... | |
HashTable< NodeId, Set< const Observation *> *> | leafDatabase_ |
This hashtable binds to every leaf an associated set of all hte observations compatible with it. More... | |
Incrementals methods | |
void | addObservation (const Observation *) |
Adds a new observation to the structure. More... | |
void | updateGraph () |
Updates the tree after a new observation has been added. More... | |
void | updateNodeWithObservation_ (const Observation *newObs, NodeId currentNodeId) |
Adds a new observation to the structure. More... | |
NodeId | insertLeafNode_ (NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar, Set< const Observation * > *sonsMap) |
Adds a new observation to the structure. More... | |
void | chgNodeBoundVar_ (NodeId chgedNodeId, const DiscreteVariable *desiredVar) |
Adds a new observation to the structure. More... | |
void | removeNode_ (NodeId removedNodeId) |
Adds a new observation to the structure. More... | |
void | _addLeaf_ (NodeId) |
Adds a new observation to the structure. More... | |
void | _removeLeaf_ (NodeId) |
Adds a new observation to the structure. More... | |
Updating private methods | |
void | updateFunctionGraph () |
Computes the score of the given variables for the given node. More... | |
void | _updateScore_ (const DiscreteVariable *, NodeId, VariableSelector &vs) |
Computes the score of the given variables for the given node. More... | |
void | _downdateScore_ (const DiscreteVariable *, NodeId, VariableSelector &vs) |
Computes the score of the given variables for the given node. More... | |
void | _updateNodeSet_ (Set< NodeId > &, const DiscreteVariable *, VariableSelector &) |
For each node in the given set, this methods checks whether or not we should installed the given variable as a test. If so, the node is updated. More... | |
void | _rebuildFunctionGraph_ () |
Computes the score of the given variables for the given node. More... | |
NodeId | _insertLeafInFunctionGraph_ (AbstractLeaf *, Int2Type< true >) |
Computes the score of the given variables for the given node. More... | |
NodeId | _insertLeafInFunctionGraph_ (AbstractLeaf *, Int2Type< false >) |
Computes the score of the given variables for the given node. More... | |
Graph Structure update methods | |
virtual void | updateVar (const DiscreteVariable *) |
If a new modality appears to exists for given variable, call this method to turn every associated node to this variable into leaf. Graph has then indeed to be revised. More... | |
void | updateNode_ (NodeId nody, Set< const DiscreteVariable * > &bestVars) |
From the given sets of node, selects randomly one and installs it on given node. More... | |
virtual void | convertNode2Leaf_ (NodeId) |
Turns the given node into a leaf if not already so. More... | |
virtual void | transpose_ (NodeId, const DiscreteVariable *) |
Installs given variable to the given node, ensuring that the variable is not present in its subtree. More... | |
virtual NodeId | insertNode_ (NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar) |
inserts a new node in internal graph More... | |
virtual NodeId | insertInternalNode_ (NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar, NodeId *sonsMap) |
inserts a new internal node in internal graph More... | |
gum::IMDDI< AttributeSelection, isScalar >::IMDDI | ( | MultiDimFunctionGraph< double > * | target, |
double | attributeSelectionThreshold, | ||
double | pairSelectionThreshold, | ||
Set< const DiscreteVariable * > | attributeListe, | ||
const DiscreteVariable * | learnedValue | ||
) |
Variable Learner constructor.
Definition at line 51 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
gum::IMDDI< AttributeSelection, isScalar >::IMDDI | ( | MultiDimFunctionGraph< double > * | target, |
double | attributeSelectionThreshold, | ||
double | pairSelectionThreshold, | ||
Set< const DiscreteVariable * > | attributeListe | ||
) |
Reward Learner constructor.
Definition at line 67 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
gum::IMDDI< AttributeSelection, isScalar >::~IMDDI | ( | ) |
Default destructor.
Definition at line 85 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
Adds a new observation to the structure.
Definition at line 282 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
Computes the score of the given variables for the given node.
Definition at line 180 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
Computes the score of the given variables for the given node.
Definition at line 377 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
Computes the score of the given variables for the given node.
Definition at line 392 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
Computes the score of the given variables for the given node.
Definition at line 320 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
Adds a new observation to the structure.
Definition at line 296 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
For each node in the given set, this methods checks whether or not we should installed the given variable as a test. If so, the node is updated.
Definition at line 198 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
Computes the score of the given variables for the given node.
Definition at line 168 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
Adds a new observation to the structure.
Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 99 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedvirtual |
Adds a new observation to the structure.
Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 257 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedvirtualinherited |
Turns the given node into a leaf if not already so.
Definition at line 200 of file incrementalGraphLearner_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedvirtualinherited |
inserts a new internal node in internal graph
nDB | : the associated database |
boundVar | : the associated variable |
sonsMap | : a table giving node's sons node |
Definition at line 362 of file incrementalGraphLearner_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedvirtual |
Adds a new observation to the structure.
Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 238 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedvirtualinherited |
inserts a new node in internal graph
nDB | : the associated database |
boundVar | : the associated variable |
Reimplemented in gum::ITI< AttributeSelection, isScalar >.
Definition at line 338 of file incrementalGraphLearner_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inlinevirtual |
Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 156 of file imddi.h.
|
inlinevirtualinherited |
Implements gum::IVisitableGraphLearner.
Definition at line 306 of file incrementalGraphLearner.h.
|
inlinevirtualinherited |
Implements gum::IVisitableGraphLearner.
Definition at line 321 of file incrementalGraphLearner.h.
|
inlinevirtualinherited |
Implements gum::IVisitableGraphLearner.
Definition at line 316 of file incrementalGraphLearner.h.
|
inlinevirtualinherited |
Implements gum::IVisitableGraphLearner.
Definition at line 311 of file incrementalGraphLearner.h.
|
protectedvirtual |
Adds a new observation to the structure.
Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 272 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inlinevirtualinherited |
Implements gum::IVisitableGraphLearner.
Definition at line 301 of file incrementalGraphLearner.h.
|
inlineinherited |
Definition at line 290 of file incrementalGraphLearner.h.
|
protectedvirtualinherited |
Installs given variable to the given node, ensuring that the variable is not present in its subtree.
Definition at line 227 of file incrementalGraphLearner_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
Computes the score of the given variables for the given node.
Implements gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 308 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
Updates the tree after a new observation has been added.
Implements gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 118 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
From the given sets of node, selects randomly one and installs it on given node.
Chechks of course if node's current variable is not in that set first.
nody | : the node we update |
bestVars | : the set of interessting vars to be installed here |
Chechks of course if node's current variable is not in that set first.
nody | : the node we update |
bestVar | : the set of interessting vars to be installed here |
Definition at line 169 of file incrementalGraphLearner_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedvirtual |
Adds a new observation to the structure.
Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.
Definition at line 105 of file imddi_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
If a new modality appears to exists for given variable, call this method to turn every associated node to this variable into leaf. Graph has then indeed to be revised.
Definition at line 147 of file incrementalGraphLearner_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
|
private |
|
private |
|
private |
|
private |
|
protectedinherited |
This hashtable binds to every leaf an associated set of all hte observations compatible with it.
Definition at line 379 of file incrementalGraphLearner.h.
|
protectedinherited |
The source of nodeId.
Definition at line 345 of file incrementalGraphLearner.h.
|
protectedinherited |
Definition at line 392 of file incrementalGraphLearner.h.
|
protectedinherited |
This hashtable binds every node to an associated NodeDatabase which handles every observation that concerns that node.
Definition at line 373 of file incrementalGraphLearner.h.
|
protectedinherited |
A table giving for any node a table mapping to its son idx is the modality of associated variable.
Definition at line 361 of file incrementalGraphLearner.h.
|
protectedinherited |
Gives for any node its associated variable.
Definition at line 355 of file incrementalGraphLearner.h.
|
protectedinherited |
The root of the ordered tree.
Definition at line 350 of file incrementalGraphLearner.h.
|
protectedinherited |
Definition at line 387 of file incrementalGraphLearner.h.
|
protectedinherited |
The final diagram we're building.
Definition at line 385 of file incrementalGraphLearner.h.
|
protectedinherited |
Definition at line 389 of file incrementalGraphLearner.h.
|
protectedinherited |
Definition at line 390 of file incrementalGraphLearner.h.
|
protectedinherited |
Associates to any variable the list of all nodes associated to this variable.
Definition at line 367 of file incrementalGraphLearner.h.