![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Implementation of a Terminal Node Policy that maps nodeid directly to value. More...
#include <agrum/base/multidim/FunctionGraphUtilities/terminalNodePolicies/ExactTerminalNodePolicy.h>
Public Member Functions | |
Terminal Node Creation and Destruction | |
| void | addTerminalNode (const NodeId &n, const GUM_SCALAR &v) |
| Insert a new terminal node with given value. | |
| void | eraseTerminalNode (const NodeId &n) |
| Remove node matching given id. | |
| void | clearAllTerminalNodes () |
| Erase all terminal nodes. | |
Terminal Nodes Existence | |
| bool | existsTerminalNodeWithId (const NodeId &n) const |
| Returns true if a terminal node matching this id exists. | |
| bool | existsTerminalNodeWithValue (const GUM_SCALAR &v) const |
| Returns true if a terminal node matching this value exists. | |
Terminal Nodes value and id access | |
| const GUM_SCALAR & | terminalNodeValue (const NodeId &n) const |
| Returns the value of the terminal node that has the given id. | |
| const NodeId & | terminalNodeId (const GUM_SCALAR &v) const |
| Returns the id of the terminal node that has the given value. | |
Iterator on Terminal Nodes | |
| void | beginValues () const |
| Initializes the constant safe iterator on terminal nodes. | |
| bool | hasValue () const |
| Indicates if constant safe iterator has reach end of terminal nodes list. | |
| void | nextValue () const |
| Increments the constant safe iterator. | |
| const GUM_SCALAR & | value () const |
| Returns the value of the current terminal nodes pointed by the constant safe iterator. | |
| const NodeId & | id () const |
| Returns the id of the current terminal nodes pointed by the constant safe iterator. | |
Private Attributes | |
| Bijection< NodeId, GUM_SCALAR > | _map_ |
| BijectionIteratorSafe< NodeId, GUM_SCALAR > | _mappy_ |
Implementation of a Terminal Node Policy that maps nodeid directly to value.
Definition at line 70 of file ExactTerminalNodePolicy.h.
|
inlinevirtual |
Insert a new terminal node with given value.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 78 of file ExactTerminalNodePolicy.h.
References _map_.
|
inlinevirtual |
Initializes the constant safe iterator on terminal nodes.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 117 of file ExactTerminalNodePolicy.h.
References _map_, and _mappy_.
Referenced by gum::StructuredPlaner< double >::evalPolicy_().
|
inlinevirtual |
Erase all terminal nodes.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 84 of file ExactTerminalNodePolicy.h.
References _map_.
Referenced by gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::clear().
|
inlinevirtual |
Remove node matching given id.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 81 of file ExactTerminalNodePolicy.h.
References _map_.
|
inlinevirtual |
Returns true if a terminal node matching this id exists.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 93 of file ExactTerminalNodePolicy.h.
References _map_.
Referenced by gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::isTerminalNode().
|
inlinevirtual |
Returns true if a terminal node matching this value exists.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 96 of file ExactTerminalNodePolicy.h.
References _map_.
|
inlinevirtual |
Indicates if constant safe iterator has reach end of terminal nodes list.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 120 of file ExactTerminalNodePolicy.h.
References _map_, and _mappy_.
Referenced by gum::StructuredPlaner< double >::evalPolicy_().
|
inlinevirtual |
Returns the id of the current terminal nodes pointed by the constant safe iterator.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 131 of file ExactTerminalNodePolicy.h.
References _mappy_.
|
inlinevirtual |
Increments the constant safe iterator.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 123 of file ExactTerminalNodePolicy.h.
References _mappy_.
Referenced by gum::StructuredPlaner< double >::evalPolicy_().
|
inlinevirtual |
Returns the id of the terminal node that has the given value.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 108 of file ExactTerminalNodePolicy.h.
References _map_.
|
inlinevirtual |
Returns the value of the terminal node that has the given id.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 105 of file ExactTerminalNodePolicy.h.
References _map_.
Referenced by gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::get(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::nodeValue(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::toDot().
|
inlinevirtual |
Returns the value of the current terminal nodes pointed by the constant safe iterator.
Implements gum::ITerminalNodePolicy< GUM_SCALAR >.
Definition at line 127 of file ExactTerminalNodePolicy.h.
References _mappy_.
Referenced by gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::set().
|
private |
Definition at line 136 of file ExactTerminalNodePolicy.h.
Referenced by addTerminalNode(), beginValues(), clearAllTerminalNodes(), eraseTerminalNode(), existsTerminalNodeWithId(), existsTerminalNodeWithValue(), hasValue(), terminalNodeId(), and terminalNodeValue().
|
mutableprivate |
Definition at line 137 of file ExactTerminalNodePolicy.h.
Referenced by beginValues(), hasValue(), id(), nextValue(), and value().