![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Class representing an Influence Diagram. More...
#include <agrum/ID/influenceDiagram.h>
Public Member Functions | |
std::string | toDot () const |
std::string | toString () const |
void | clear () |
bool | hasSameStructure (const DAGmodel &other) |
double | log10DomainSize () const |
Constructors / Destructors | |
InfluenceDiagram () | |
Default constructor. More... | |
~InfluenceDiagram () override | |
Destructor. More... | |
InfluenceDiagram (const InfluenceDiagram< GUM_SCALAR > &source) | |
Copy Constructor. More... | |
InfluenceDiagram< GUM_SCALAR > & | operator= (const InfluenceDiagram< GUM_SCALAR > &source) |
Copy Operator. More... | |
Variable manipulation methods. | |
virtual const Potential< GUM_SCALAR > & | cpt (NodeId varId) const |
Returns the CPT of a potential variable. More... | |
virtual const Potential< GUM_SCALAR > & | cpt (std::string name) const final |
Returns the CPT of a potential variable. More... | |
virtual const Potential< GUM_SCALAR > & | utility (NodeId varId) const |
Returns the utility table of a utility node. More... | |
virtual const Potential< GUM_SCALAR > & | utility (std::string name) const final |
Returns the CPT of a potential variable. More... | |
const VariableNodeMap & | variableNodeMap () const final |
Returns a constant reference to the VariableNodeMap of this Influence Diagram. More... | |
bool | isUtilityNode (NodeId varId) const |
Returns true if node is a utility one. More... | |
bool | isUtilityNode (const std::string &name) const |
Returns the CPT of a potential variable. More... | |
bool | isDecisionNode (NodeId varId) const |
Returns true if node is a decision one. More... | |
bool | isDecisionNode (const std::string &name) const |
Returns the CPT of a potential variable. More... | |
bool | isChanceNode (NodeId varId) const |
Returns true if node is a chance one. More... | |
bool | isChanceNode (const std::string &name) const |
Returns the CPT of a potential variable. More... | |
Size | utilityNodeSize () const |
Returns the number of utility nodes. More... | |
Size | chanceNodeSize () const |
Returns the number of chance nodes. More... | |
Size | decisionNodeSize () const |
Returns the number of decision nodes. More... | |
const DiscreteVariable & | variable (NodeId id) const final |
Returns a constant reference over a variable given it's node id. More... | |
NodeId | nodeId (const DiscreteVariable &var) const final |
Return id node from discrete var pointer. More... | |
NodeId | idFromName (const std::string &name) const final |
Getter by name. More... | |
const DiscreteVariable & | variableFromName (const std::string &name) const final |
Getter by name. More... | |
NodeId | add (const DiscreteVariable &variable, NodeId id=0) |
Add a chance variable, it's associate node and it's CPT. More... | |
NodeId | addChanceNode (const DiscreteVariable &variable, NodeId id=0) |
Add a chance variable, it's associate node and it's CPT. More... | |
NodeId | addUtilityNode (const DiscreteVariable &variable, NodeId id=0) |
Add a utility variable, it's associate node and it's UT. More... | |
NodeId | addDecisionNode (const DiscreteVariable &variable, NodeId id=0) |
Add a decision variable. More... | |
NodeId | addChanceNode (const DiscreteVariable &variable, MultiDimImplementation< GUM_SCALAR > *aContent, NodeId id=0) |
Add a chance variable, it's associate node and it's CPT. More... | |
NodeId | addUtilityNode (const DiscreteVariable &variable, MultiDimImplementation< GUM_SCALAR > *aContent, NodeId id=0) |
Add a chance variable, it's associate node and it's CPT. More... | |
void | erase (NodeId id) |
Erase a Variable from the network and remove the variable from all his children. More... | |
void | erase (const std::string &name) |
Returns the CPT of a potential variable. More... | |
void | erase (const DiscreteVariable &var) |
Erase a Variable from the network and remove the variable from all his children. More... | |
void | changeVariableName (NodeId id, const std::string &new_name) |
we allow the user to change the name of a variable More... | |
void | changeVariableName (const std::string &name, const std::string &new_name) |
Returns the CPT of a potential variable. More... | |
Arc manipulation methods. | |
void | addArc (NodeId tail, NodeId head) |
Add an arc in the ID, and update diagram's potential nodes cpt if necessary. More... | |
void | addArc (const std::string &tail, const std::string &head) |
Add an arc in the ID, and update diagram's potential nodes cpt if necessary. More... | |
void | eraseArc (const Arc &arc) |
Removes an arc in the ID, and update diagram's potential nodes cpt if necessary. More... | |
void | eraseArc (NodeId tail, NodeId head) |
Removes an arc in the ID, and update diagram's potential nodes cpt if necessary. More... | |
void | eraseArc (const std::string &tail, const std::string &head) |
Add an arc in the ID, and update diagram's potential nodes cpt if necessary. More... | |
Decisions methods | |
bool | decisionOrderExists () const |
True if a directed path exist with all decision nodes. More... | |
gum::DAG * | getDecisionGraph () const |
Returns the temporal Graph. More... | |
std::vector< NodeId > | decisionOrder () const |
Returns the sequence of decision nodes in the directed path. More... | |
bool | existsPathBetween (NodeId src, NodeId dest) const |
Returns true if a path exists between two nodes. More... | |
bool | existsPathBetween (const std::string &src, const std::string &dest) const |
True if a directed path exist with all decision nodes. More... | |
const List< NodeSet > & | getPartialTemporalOrder (bool clear=true) const |
Returns partial temporal ordering. More... | |
Variable manipulation methods. | |
const DAG & | dag () const |
Returns a constant reference to the dag of this Bayes Net. More... | |
virtual Size | size () const final |
Returns the number of variables in this Directed Graphical Model. More... | |
Size | sizeArcs () const |
Returns the number of arcs in this Directed Graphical Model. More... | |
const NodeGraphPart & | nodes () const final |
Returns a constant reference to the dag of this Bayes Net. More... | |
bool | exists (NodeId node) const final |
Return true if this node exists in this graphical model. More... | |
Variable manipulation methods. | |
bool | exists (const std::string &name) const |
Return true if this graphical model is empty. More... | |
virtual bool | empty () const |
Return true if this graphical model is empty. More... | |
std::vector< std::string > | names (const std::vector< NodeId > &ids) const |
transform a vector of NodeId in a vector of names More... | |
std::vector< std::string > | names (const NodeSet &ids) const |
transform a NodeSet in a vector of names More... | |
std::vector< NodeId > | ids (const std::vector< std::string > &names) const |
transform a vector of names into a vector of nodeId More... | |
NodeSet | nodeset (const std::vector< std::string > &names) const |
transform a vector of names into a NodeSet More... | |
Instantiation | completeInstantiation () const |
Get an instantiation over all the variables of the model. More... | |
Arc manipulation methods. | |
const ArcSet & | arcs () const |
return true if the arc tail->head exists in the DAGmodel More... | |
bool | existsArc (const NodeId tail, const NodeId head) const |
return true if the arc tail->head exists in the DAGmodel More... | |
bool | existsArc (const std::string &nametail, const std::string &namehead) const |
return true if the arc tail->head exists in the DAGmodel More... | |
const NodeSet & | parents (const NodeId id) const |
returns the set of nodes with arc ingoing to a given node More... | |
const NodeSet & | parents (const std::string &name) const |
return true if the arc tail->head exists in the DAGmodel More... | |
NodeSet | parents (const NodeSet &ids) const |
returns the parents of a set of nodes More... | |
NodeSet | parents (const std::vector< std::string > &names) const |
return true if the arc tail->head exists in the DAGmodel More... | |
NodeSet | family (const NodeId id) const |
returns the parents of a node and the node More... | |
NodeSet | family (const std::string &name) const |
return true if the arc tail->head exists in the DAGmodel More... | |
const NodeSet & | children (const NodeId id) const |
returns the set of nodes with arc outgoing from a given node More... | |
const NodeSet & | children (const std::string &name) const |
return true if the arc tail->head exists in the DAGmodel More... | |
NodeSet | children (const NodeSet &ids) const |
returns the children of a set of nodes More... | |
NodeSet | children (const std::vector< std::string > &names) const |
return true if the arc tail->head exists in the DAGmodel More... | |
NodeSet | descendants (const NodeId id) const |
returns the set of nodes with directed path outgoing from a given node More... | |
NodeSet | descendants (const std::string &name) const |
return true if the arc tail->head exists in the DAGmodel More... | |
NodeSet | ancestors (const NodeId id) const |
returns the set of nodes with directed path ingoing to a given node More... | |
NodeSet | ancestors (const std::string &name) const |
return true if the arc tail->head exists in the DAGmodel More... | |
Graphical methods | |
UndiGraph | moralizedAncestralGraph (const NodeSet &nodes) const |
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes More... | |
UndiGraph | moralizedAncestralGraph (const std::vector< std::string > &nodenames) const |
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes More... | |
bool | isIndependent (NodeId X, NodeId Y, const NodeSet &Z) const final |
check if node X and node Y are independent given nodes Z More... | |
bool | isIndependent (const NodeSet &X, const NodeSet &Y, const NodeSet &Z) const final |
check if nodes X and nodes Y are independent given nodes Z More... | |
bool | isIndependent (const std::string &Xname, const std::string &Yname, const std::vector< std::string > &Znames) const |
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes More... | |
bool | isIndependent (const std::vector< std::string > &Xnames, const std::vector< std::string > &Ynames, const std::vector< std::string > &Znames) const |
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes More... | |
const UndiGraph & | moralGraph (bool clear=true) const |
The node's id are coherent with the variables and nodes of the topology. More... | |
const Sequence< NodeId > & | topologicalOrder (bool clear=true) const |
The topological order stays the same as long as no variable or arcs are added or erased src the topology. More... | |
Getter and setters | |
const std::string & | property (const std::string &name) const |
Return the value of the property name of this GraphicalModel. More... | |
const std::string & | propertyWithDefault (const std::string &name, const std::string &byDefault) const |
Return the value of the property name of this GraphicalModel. More... | |
void | setProperty (const std::string &name, const std::string &value) |
Add or change a property of this GraphicalModel. More... | |
Static Public Member Functions | |
static InfluenceDiagram< GUM_SCALAR > | fastPrototype (const std::string &dotlike, Size domainSize=2) |
Create an Influence Diagram with a dot-like syntax which specifies: More... | |
Protected Attributes | |
DAG | dag_ |
The DAG of this Directed Graphical Model. More... | |
Protected Member Functions | |
virtual void | moralGraph_ (UndiGraph &graph) const |
Returns the moral graph of this InfluenceDiagram. More... | |
void | removeTables_ () |
Removing ancient table. More... | |
void | copyStructureAndTables_ (const InfluenceDiagram< GUM_SCALAR > &IDsource) |
Copying tables from another influence diagram. More... | |
NodeId | addNode_ (const DiscreteVariable &variableType, NodeId DesiredId) |
Add a node. More... | |
Sequence< NodeId > | getChildrenDecision_ (NodeId parentDecision) const |
Returns the list of children decision for a given nodeId. More... | |
Class representing an Influence Diagram.
Definition at line 53 of file influenceDiagram.h.
INLINE gum::InfluenceDiagram< GUM_SCALAR >::InfluenceDiagram | ( | ) |
Default constructor.
Definition at line 194 of file influenceDiagram_tpl.h.
|
override |
Destructor.
Definition at line 202 of file influenceDiagram_tpl.h.
gum::InfluenceDiagram< GUM_SCALAR >::InfluenceDiagram | ( | const InfluenceDiagram< GUM_SCALAR > & | source | ) |
Copy Constructor.
Definition at line 211 of file influenceDiagram_tpl.h.
NodeId gum::InfluenceDiagram< GUM_SCALAR >::add | ( | const DiscreteVariable & | variable, |
NodeId | id = 0 |
||
) |
Add a chance variable, it's associate node and it's CPT.
The id of the new variable is automatically generated.
The implementation of the Potential is by default a MultiDimArray.
variable | The variable added by copy. |
id | The chosen id. If 0, the NodeGraphPart will choose. |
DuplicateElement | if id(<>0) is already used |
Definition at line 485 of file influenceDiagram_tpl.h.
INLINE void gum::InfluenceDiagram< GUM_SCALAR >::addArc | ( | NodeId | tail, |
NodeId | head | ||
) |
Add an arc in the ID, and update diagram's potential nodes cpt if necessary.
head | and |
tail | as NodeId |
InvalidEdge | If arc.tail and/or arc.head are not in the ID. |
InvalidEdge | if tail is a utility node |
Definition at line 658 of file influenceDiagram_tpl.h.
|
inline |
Add an arc in the ID, and update diagram's potential nodes cpt if necessary.
head | and |
tail | as NodeId |
InvalidEdge | If arc.tail and/or arc.head are not in the ID. |
InvalidEdge | if tail is a utility node |
Definition at line 339 of file influenceDiagram.h.
NodeId gum::InfluenceDiagram< GUM_SCALAR >::addChanceNode | ( | const DiscreteVariable & | variable, |
NodeId | id = 0 |
||
) |
Add a chance variable, it's associate node and it's CPT.
The id of the new variable is automatically generated.
The implementation of the Potential is by default a MultiDimArray.
variable | The variable added by copy. |
id | The chosen id. If 0, the NodeGraphPart will choose. |
DuplicateElement | if id(<>0) is already used |
Definition at line 524 of file influenceDiagram_tpl.h.
NodeId gum::InfluenceDiagram< GUM_SCALAR >::addChanceNode | ( | const DiscreteVariable & | variable, |
MultiDimImplementation< GUM_SCALAR > * | aContent, | ||
NodeId | id = 0 |
||
) |
Add a chance variable, it's associate node and it's CPT.
The id of the new variable is automatically generated.
variable | The variable added by copy. |
aContent | The content used for the variable potential. |
id | The chosen id. If 0, the NodeGraphPart will choose. |
DuplicateElement | if id(<>0) is already used |
Definition at line 544 of file influenceDiagram_tpl.h.
NodeId gum::InfluenceDiagram< GUM_SCALAR >::addDecisionNode | ( | const DiscreteVariable & | variable, |
NodeId | id = 0 |
||
) |
Add a decision variable.
The id of the new variable is automatically generated.
variable | The variable added by copy. |
id | The chosen id. If 0, the NodeGraphPart will choose. |
DuplicateElement | if id(<>0) is already used |
Definition at line 514 of file influenceDiagram_tpl.h.
|
protected |
Add a node.
Definition at line 587 of file influenceDiagram_tpl.h.
NodeId gum::InfluenceDiagram< GUM_SCALAR >::addUtilityNode | ( | const DiscreteVariable & | variable, |
NodeId | id = 0 |
||
) |
Add a utility variable, it's associate node and it's UT.
The id of the new variable is automatically generated.
The implementation of the Utility is by default a MultiDimArray.
variable | The variable added by copy. |
id | The chosen id. If 0, the NodeGraphPart will choose. |
InvalidArgument | If variable has more than one label |
DuplicateElement | if id(<>0) is already used |
Definition at line 495 of file influenceDiagram_tpl.h.
NodeId gum::InfluenceDiagram< GUM_SCALAR >::addUtilityNode | ( | const DiscreteVariable & | variable, |
MultiDimImplementation< GUM_SCALAR > * | aContent, | ||
NodeId | id = 0 |
||
) |
Add a chance variable, it's associate node and it's CPT.
The id of the new variable is automatically generated.
variable | The variable added by copy. |
aContent | The content used for the variable utility. |
id | The chosen id. If 0, the NodeGraphPart will choose. |
InvalidArgument | If variable has more than one label |
DuplicateElement | if id(<>0) is already used |
Definition at line 563 of file influenceDiagram_tpl.h.
returns the set of nodes with directed path ingoing to a given node
Note that the set of nodes returned may be empty if no path within the ArcGraphPart is ingoing to the given node.
id | the node which is the head of a directed path with the returned nodes |
name | the name of the node which is the head of a directed path with the returned nodes |
Definition at line 96 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 98 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 43 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE Size gum::InfluenceDiagram< GUM_SCALAR >::chanceNodeSize | ( | ) | const |
Returns the number of chance nodes.
Definition at line 430 of file influenceDiagram_tpl.h.
INLINE void gum::InfluenceDiagram< GUM_SCALAR >::changeVariableName | ( | NodeId | id, |
const std::string & | new_name | ||
) |
we allow the user to change the name of a variable
DuplicateLabel | if this name already exists |
NotFound | Raised if no nodes matches id. |
Definition at line 646 of file influenceDiagram_tpl.h.
|
inline |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 319 of file influenceDiagram.h.
returns the set of nodes with arc outgoing from a given node
Note that the set of nodes returned may be empty if no node is outgoing from the given node.
id | the node which is the tail of an arc with the returned nodes |
name | the name of the node which is the tail of an arc with the returned nodes |
Definition at line 65 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 66 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
returns the children of a set of nodes
Definition at line 70 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 72 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
void gum::InfluenceDiagram< GUM_SCALAR >::clear | ( | ) |
|
inherited |
Get an instantiation over all the variables of the model.
Definition at line 84 of file graphicalModel_inl.h.
|
protected |
Copying tables from another influence diagram.
Definition at line 258 of file influenceDiagram_tpl.h.
|
virtual |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 377 of file influenceDiagram_tpl.h.
|
inlinefinalvirtual |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 130 of file influenceDiagram.h.
|
inherited |
Returns a constant reference to the dag of this Bayes Net.
Definition at line 35 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE Size gum::InfluenceDiagram< GUM_SCALAR >::decisionNodeSize | ( | ) | const |
Returns the number of decision nodes.
Definition at line 438 of file influenceDiagram_tpl.h.
std::vector< NodeId > gum::InfluenceDiagram< GUM_SCALAR >::decisionOrder | ( | ) | const |
Returns the sequence of decision nodes in the directed path.
NotFound | if such a path does not exist |
Definition at line 856 of file influenceDiagram_tpl.h.
bool gum::InfluenceDiagram< GUM_SCALAR >::decisionOrderExists | ( | ) | const |
True if a directed path exist with all decision nodes.
Definition at line 729 of file influenceDiagram_tpl.h.
returns the set of nodes with directed path outgoing from a given node
Note that the set of nodes returned may be empty if no path within the ArcGraphPart is outgoing from the given node.
id | the node which is the tail of a directed path with the returned nodes |
name | the name of the node which is the tail of a directed path with the returned nodes |
Definition at line 90 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 92 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Return true if this graphical model is empty.
Definition at line 94 of file graphicalModel_inl.h.
void gum::InfluenceDiagram< GUM_SCALAR >::erase | ( | NodeId | id | ) |
Erase a Variable from the network and remove the variable from all his children.
If no variable matches the id, then nothing is done.
id | The id of the variable to erase. |
Definition at line 611 of file influenceDiagram_tpl.h.
|
inline |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 303 of file influenceDiagram.h.
INLINE void gum::InfluenceDiagram< GUM_SCALAR >::erase | ( | const DiscreteVariable & | var | ) |
Erase a Variable from the network and remove the variable from all his children.
If no variable matches, then nothing is done.
var | The reference on the variable to remove. |
Definition at line 639 of file influenceDiagram_tpl.h.
INLINE void gum::InfluenceDiagram< GUM_SCALAR >::eraseArc | ( | const Arc & | arc | ) |
Removes an arc in the ID, and update diagram's potential nodes cpt if necessary.
If (tail, head) doesn't exist, the nothing happens.
arc | The arc removed. |
Definition at line 678 of file influenceDiagram_tpl.h.
INLINE void gum::InfluenceDiagram< GUM_SCALAR >::eraseArc | ( | NodeId | tail, |
NodeId | head | ||
) |
Removes an arc in the ID, and update diagram's potential nodes cpt if necessary.
If (tail, head) doesn't exist, the nothing happens.
head | and |
tail | as NodeId |
Definition at line 698 of file influenceDiagram_tpl.h.
|
inline |
Add an arc in the ID, and update diagram's potential nodes cpt if necessary.
head | and |
tail | as NodeId |
InvalidEdge | If arc.tail and/or arc.head are not in the ID. |
InvalidEdge | if tail is a utility node |
Definition at line 361 of file influenceDiagram.h.
Return true if this node exists in this graphical model.
Implements gum::GraphicalModel.
Definition at line 82 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inlineinherited |
Return true if this graphical model is empty.
Definition at line 112 of file graphicalModel.h.
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 45 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 49 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
bool gum::InfluenceDiagram< GUM_SCALAR >::existsPathBetween | ( | NodeId | src, |
NodeId | dest | ||
) | const |
Returns true if a path exists between two nodes.
Definition at line 761 of file influenceDiagram_tpl.h.
|
inline |
True if a directed path exist with all decision nodes.
Definition at line 392 of file influenceDiagram.h.
returns the parents of a node and the node
Note that the set of nodes returned may be empty if no arc within the ArcGraphPart is ingoing into the given node.
id | the node which is the head of an arc with the returned nodes |
name | the name of the node the node which is the head of an arc with the returned nodes |
Definition at line 59 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 61 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
static |
Create an Influence Diagram with a dot-like syntax which specifies:
Note that if the dot-like string contains such a specification more than once for a variable, the first specification will be used.
dotlike | the string containing the specification |
domainSize | the default domain size for chance and decision variables |
Definition at line 149 of file influenceDiagram_tpl.h.
|
protected |
Returns the list of children decision for a given nodeId.
Definition at line 818 of file influenceDiagram_tpl.h.
gum::DAG * gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph | ( | ) | const |
Returns the temporal Graph.
Definition at line 795 of file influenceDiagram_tpl.h.
const List< NodeSet > & gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder | ( | bool | clear = true | ) | const |
Returns partial temporal ordering.
NotFound | if such a sequence does not exist |
Definition at line 872 of file influenceDiagram_tpl.h.
Definition at line 69 of file DAGmodel.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
Getter by name.
NotFound | if no such name exists in the graph. |
Implements gum::GraphicalModel.
Definition at line 469 of file influenceDiagram_tpl.h.
|
inherited |
transform a vector of names into a vector of nodeId
Definition at line 117 of file graphicalModel_inl.h.
INLINE bool gum::InfluenceDiagram< GUM_SCALAR >::isChanceNode | ( | NodeId | varId | ) | const |
Returns true if node is a chance one.
Definition at line 414 of file influenceDiagram_tpl.h.
|
inline |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 164 of file influenceDiagram.h.
INLINE bool gum::InfluenceDiagram< GUM_SCALAR >::isDecisionNode | ( | NodeId | varId | ) | const |
Returns true if node is a decision one.
Definition at line 402 of file influenceDiagram_tpl.h.
|
inline |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 158 of file influenceDiagram.h.
|
finalvirtualinherited |
check if node X and node Y are independent given nodes Z
Implements gum::GraphicalModel.
Definition at line 113 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
check if nodes X and nodes Y are independent given nodes Z
Implements gum::GraphicalModel.
Definition at line 117 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inlineinherited |
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes
nodes | the set of nodeId |
nodenames | the vector of names of nodes |
Definition at line 185 of file DAGmodel.h.
|
inlineinherited |
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes
nodes | the set of nodeId |
nodenames | the vector of names of nodes |
Definition at line 191 of file DAGmodel.h.
INLINE bool gum::InfluenceDiagram< GUM_SCALAR >::isUtilityNode | ( | NodeId | varId | ) | const |
Returns true if node is a utility one.
Definition at line 394 of file influenceDiagram_tpl.h.
|
inline |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 153 of file influenceDiagram.h.
|
inherited |
Definition at line 73 of file graphicalModel_inl.h.
The node's id are coherent with the variables and nodes of the topology.
clear | If false returns the previously created moral graph. |
Definition at line 55 of file DAGmodel.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protectedvirtual |
Returns the moral graph of this InfluenceDiagram.
Definition at line 710 of file influenceDiagram_tpl.h.
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes
nodes | the set of nodeId |
nodenames | the vector of names of nodes |
Definition at line 109 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes
nodes | the set of nodeId |
nodenames | the vector of names of nodes |
Definition at line 104 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
transform a vector of NodeId in a vector of names
Definition at line 97 of file graphicalModel_inl.h.
|
inherited |
transform a NodeSet in a vector of names
Definition at line 107 of file graphicalModel_inl.h.
|
finalvirtual |
Return id node from discrete var pointer.
NotFound | If no variable matches var. |
Implements gum::GraphicalModel.
Definition at line 463 of file influenceDiagram_tpl.h.
|
finalvirtualinherited |
Returns a constant reference to the dag of this Bayes Net.
Implements gum::GraphicalModel.
Definition at line 84 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
transform a vector of names into a NodeSet
Definition at line 58 of file graphicalModel.cpp.
References gum::Set< Key, Alloc >::emplace().
InfluenceDiagram< GUM_SCALAR > & gum::InfluenceDiagram< GUM_SCALAR >::operator= | ( | const InfluenceDiagram< GUM_SCALAR > & | source | ) |
Copy Operator.
Definition at line 221 of file influenceDiagram_tpl.h.
returns the set of nodes with arc ingoing to a given node
Note that the set of nodes returned may be empty if no arc within the ArcGraphPart is ingoing into the given node.
id | the node which is the head of an arc with the returned nodes |
name | the name of the node the node which is the head of an arc with the returned nodes |
Definition at line 53 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 55 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
returns the parents of a set of nodes
Definition at line 76 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
return true if the arc tail->head exists in the DAGmodel
tail | the nodeId (or the name) of the tail in tail->head |
head | the nodeId (or the name) of the head in tail->head |
Definition at line 78 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Return the value of the property name of this GraphicalModel.
NotFound | Raised if no name property is found. |
Definition at line 38 of file graphicalModel_inl.h.
|
inherited |
Return the value of the property name of this GraphicalModel.
return byDefault if the property name is not found
Definition at line 57 of file graphicalModel_inl.h.
|
protected |
Removing ancient table.
Definition at line 245 of file influenceDiagram_tpl.h.
|
inherited |
Add or change a property of this GraphicalModel.
Definition at line 65 of file graphicalModel_inl.h.
|
finalvirtualinherited |
Returns the number of variables in this Directed Graphical Model.
Implements gum::GraphicalModel.
Definition at line 38 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Returns the number of arcs in this Directed Graphical Model.
Definition at line 41 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
std::string gum::InfluenceDiagram< GUM_SCALAR >::toDot | ( | ) | const |
Definition at line 296 of file influenceDiagram_tpl.h.
|
inherited |
The topological order stays the same as long as no variable or arcs are added or erased src the topology.
clear | If false returns the previously created topology. |
Definition at line 86 of file DAGmodel_inl.h.
References gum::Set< Key, Alloc >::emplace().
std::string gum::InfluenceDiagram< GUM_SCALAR >::toString | ( | ) | const |
Definition at line 348 of file influenceDiagram_tpl.h.
|
virtual |
Returns the utility table of a utility node.
NotFound | If no variable's id matches varId. |
Definition at line 386 of file influenceDiagram_tpl.h.
|
inlinefinalvirtual |
Returns the CPT of a potential variable.
NotFound | If no variable's id matches varId. |
Definition at line 139 of file influenceDiagram.h.
INLINE Size gum::InfluenceDiagram< GUM_SCALAR >::utilityNodeSize | ( | ) | const |
Returns the number of utility nodes.
Definition at line 422 of file influenceDiagram_tpl.h.
|
finalvirtual |
Returns a constant reference over a variable given it's node id.
NotFound | If no variable's id matches varId. |
Implements gum::GraphicalModel.
Definition at line 455 of file influenceDiagram_tpl.h.
|
finalvirtual |
Getter by name.
NotFound | if no such name exists in the graph. |
Implements gum::GraphicalModel.
Definition at line 476 of file influenceDiagram_tpl.h.
|
finalvirtual |
Returns a constant reference to the VariableNodeMap of this Influence Diagram.
Implements gum::GraphicalModel.
Definition at line 447 of file influenceDiagram_tpl.h.
|
private |
Mapping between potential variable's id and their CPT.
Definition at line 433 of file influenceDiagram.h.
|
mutableprivate |
The temporal order.
Definition at line 438 of file influenceDiagram.h.
|
private |
Mapping between utility variable's id and their utility table.
Definition at line 435 of file influenceDiagram.h.
|
private |
Mapping between id and variable.
Definition at line 430 of file influenceDiagram.h.
|
protectedinherited |
The DAG of this Directed Graphical Model.
Definition at line 222 of file DAGmodel.h.