![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Class representing an Influence Diagram. More...
#include <agrum/ID/influenceDiagram.h>
Public Member Functions | |
| bool | operator== (const InfluenceDiagram< GUM_SCALAR > &other) const |
| bool | operator!= (const InfluenceDiagram< GUM_SCALAR > &other) const |
| std::string | toDot () const |
| std::string | toString () const |
| void | clear () |
| bool | hasSameStructure (const DAGmodel &other) |
| NodeSet | minimalCondSet (NodeId target, const NodeSet &soids) const |
| NodeSet | minimalCondSet (const NodeSet &targets, const NodeSet &soids) const |
| NodeSet | minimalCondSet (const std::string &target, const std::vector< std::string > &soids) const |
| NodeSet | minimalCondSet (const std::vector< std::string > &targets, const std::vector< std::string > &soids) const |
| double | log10DomainSize () const |
Constructors / Destructors | |
| InfluenceDiagram () | |
| Default constructor. | |
| ~InfluenceDiagram () override | |
| Destructor. | |
| InfluenceDiagram (const InfluenceDiagram< GUM_SCALAR > &source) | |
| Copy Constructor. | |
| InfluenceDiagram< GUM_SCALAR > & | operator= (const InfluenceDiagram< GUM_SCALAR > &source) |
| Copy Operator. | |
Variable manipulation methods. | |
| virtual const Tensor< GUM_SCALAR > & | cpt (NodeId varId) const |
| Returns the CPT of a tensor variable. | |
| virtual const Tensor< GUM_SCALAR > & | cpt (std::string name) const final |
| Returns the CPT of a tensor variable. | |
| virtual const Tensor< GUM_SCALAR > & | utility (NodeId varId) const |
| Returns the utility table of a utility node. | |
| virtual const Tensor< GUM_SCALAR > & | utility (std::string name) const final |
| Returns the CPT of a tensor variable. | |
| const VariableNodeMap & | variableNodeMap () const final |
| Returns a constant reference to the VariableNodeMap of this Influence Diagram. | |
| bool | isUtilityNode (NodeId varId) const |
| Returns true if node is a utility one. | |
| bool | isUtilityNode (const std::string &name) const |
| Returns the CPT of a tensor variable. | |
| bool | isDecisionNode (NodeId varId) const |
| Returns true if node is a decision one. | |
| bool | isDecisionNode (const std::string &name) const |
| Returns the CPT of a tensor variable. | |
| bool | isChanceNode (NodeId varId) const |
| Returns true if node is a chance one. | |
| bool | isChanceNode (const std::string &name) const |
| Returns the CPT of a tensor variable. | |
| Size | utilityNodeSize () const |
| Returns the number of utility nodes. | |
| Size | chanceNodeSize () const |
| Returns the number of chance nodes. | |
| Size | decisionNodeSize () const |
| Returns the number of decision nodes. | |
| const DiscreteVariable & | variable (NodeId id) const final |
| Returns a constant reference over a variable given it's node id. | |
| const DiscreteVariable & | variable (const std::string &name) const |
| Returns the CPT of a tensor variable. | |
| NodeId | nodeId (const DiscreteVariable &var) const final |
| Return id node from discrete var pointer. | |
| NodeId | idFromName (const std::string &name) const final |
| Getter by name. | |
| const DiscreteVariable & | variableFromName (const std::string &name) const final |
| Getter by name. | |
| NodeId | add (const DiscreteVariable &variable, NodeId id=0) |
| Add a chance variable, it's associate node and it's CPT. | |
| NodeId | addChanceNode (const DiscreteVariable &variable, NodeId id=0) |
| Add a chance variable, it's associate node and it's CPT. | |
| NodeId | addUtilityNode (const DiscreteVariable &variable, NodeId id=0) |
| Add a utility variable, it's associate node and it's UT. | |
| NodeId | addDecisionNode (const DiscreteVariable &variable, NodeId id=0) |
| Add a decision variable. | |
| NodeId | addChanceNode (const DiscreteVariable &variable, MultiDimImplementation< GUM_SCALAR > *aContent, NodeId id=0) |
| Add a chance variable, it's associate node and it's CPT. | |
| NodeId | addUtilityNode (const DiscreteVariable &variable, MultiDimImplementation< GUM_SCALAR > *aContent, NodeId id=0) |
| Add a chance variable, it's associate node and it's CPT. | |
| NodeId | add (const std::string &fast_description, unsigned int default_nbrmod=2) |
| Add a chance, a decision or an utility variable from a description in "fast" syntax. | |
| NodeId | addChanceNode (const std::string &fast_description, unsigned int default_nbrmod=2) |
| Add a chance variable from a description in "fast" syntax. | |
| NodeId | addUtilityNode (const std::string &fast_description) |
| Add a utility variable from a description in "fast" syntax with only one value. | |
| NodeId | addDecisionNode (const std::string &fast_description, unsigned int default_nbrmod=2) |
| Add a decision variable from a description in "fast" syntax. | |
| void | erase (NodeId id) |
| Erase a Variable from the network and remove the variable from all his children. | |
| void | erase (const std::string &name) |
| Returns the CPT of a tensor variable. | |
| void | erase (const DiscreteVariable &var) |
| Erase a Variable from the network and remove the variable from all his children. | |
| void | changeVariableName (NodeId id, const std::string &new_name) |
| we allow the user to change the name of a variable | |
| void | changeVariableName (const std::string &name, const std::string &new_name) |
| Returns the CPT of a tensor variable. | |
Arc manipulation methods. | |
| void | addArc (NodeId tail, NodeId head) |
| Add an arc in the ID, and update diagram's tensor nodes cpt if necessary. | |
| void | addArc (const std::string &tail, const std::string &head) |
| Add an arc in the ID, and update diagram's tensor nodes cpt if necessary. | |
| void | eraseArc (const Arc &arc) |
| Removes an arc in the ID, and update diagram's tensor nodes cpt if necessary. | |
| void | eraseArc (NodeId tail, NodeId head) |
| Removes an arc in the ID, and update diagram's tensor nodes cpt if necessary. | |
| void | eraseArc (const std::string &tail, const std::string &head) |
| Add an arc in the ID, and update diagram's tensor nodes cpt if necessary. | |
Decisions methods | |
| bool | decisionOrderExists () const |
| True if a directed path exist with all decision nodes. | |
| gum::DAG * | getDecisionGraph () const |
| Returns the temporal Graph. | |
| std::vector< NodeId > | decisionOrder () const |
| Returns the sequence of decision nodes in the directed path. | |
| bool | existsPathBetween (NodeId src, NodeId dest) const |
| Returns true if a path exists between two nodes. | |
| bool | existsPathBetween (const std::string &src, const std::string &dest) const |
| True if a directed path exist with all decision nodes. | |
| const List< NodeSet > & | getPartialTemporalOrder (bool clear=true) const |
| Returns partial temporal ordering. | |
| void | beginTopologyTransformation () |
| When inserting/removing arcs, node CPTs/utilities change their dimension with a cost in time. | |
| void | endTopologyTransformation () |
| terminates a sequence of insertions/deletions of arcs by adjusting all CPTs/utilities dimensions. | |
Variable manipulation methods. | |
| const DAG & | dag () const |
| Returns a constant reference to the dag of this Bayes Net. | |
| virtual Size | size () const final |
| Returns the number of variables in this Directed Graphical Model. | |
| Size | sizeArcs () const |
| Returns the number of arcs in this Directed Graphical Model. | |
| const NodeGraphPart & | nodes () const final |
| Returns a constant reference to the dag of this Bayes Net. | |
| bool | exists (NodeId node) const final |
| Return true if this node exists in this graphical model. | |
| bool | exists (const std::string &name) const final |
| Returns a constant reference to the dag of this Bayes Net. | |
Arc manipulation methods. | |
| const ArcSet & | arcs () const |
| return true if the arc tail->head exists in the DAGmodel | |
| bool | existsArc (const NodeId tail, const NodeId head) const |
| return true if the arc tail->head exists in the DAGmodel | |
| bool | existsArc (const std::string &nametail, const std::string &namehead) const |
| return true if the arc tail->head exists in the DAGmodel | |
| const NodeSet & | parents (const NodeId id) const |
| returns the set of nodes with arc ingoing to a given node | |
| const NodeSet & | parents (const std::string &name) const |
| return true if the arc tail->head exists in the DAGmodel | |
| NodeSet | parents (const NodeSet &ids) const |
| returns the parents of a set of nodes | |
| NodeSet | parents (const std::vector< std::string > &names) const |
| return true if the arc tail->head exists in the DAGmodel | |
| NodeSet | family (const NodeId id) const final |
| returns the parents of a node and the node | |
| NodeSet | family (const std::string &name) const final |
| return true if the arc tail->head exists in the DAGmodel | |
| const NodeSet & | children (const NodeId id) const |
| returns the set of nodes with arc outgoing from a given node | |
| const NodeSet & | children (const std::string &name) const |
| return true if the arc tail->head exists in the DAGmodel | |
| NodeSet | children (const NodeSet &ids) const |
| returns the children of a set of nodes | |
| NodeSet | children (const std::vector< std::string > &names) const |
| return true if the arc tail->head exists in the DAGmodel | |
| NodeSet | descendants (const NodeId id) const |
| returns the set of nodes with directed path outgoing from a given node | |
| NodeSet | descendants (const std::string &name) const |
| return true if the arc tail->head exists in the DAGmodel | |
| NodeSet | ancestors (const NodeId id) const |
| returns the set of nodes with directed path ingoing to a given node | |
| NodeSet | ancestors (const std::string &name) const |
| return true if the arc tail->head exists in the DAGmodel | |
Graphical methods | |
| UndiGraph | moralizedAncestralGraph (const NodeSet &nodes) const |
| build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes | |
| UndiGraph | moralizedAncestralGraph (const std::vector< std::string > &nodenames) const |
| build a UndiGraph by moralizing the Ancestral Graph of a set of Nodes | |
| bool | isIndependent (NodeId X, NodeId Y, const NodeSet &Z) const final |
| check if node X and node Y are independent given nodes Z | |
| 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 | |
| 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 | |
| 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 | |
| UndiGraph | moralGraph () const |
| The node's id are coherent with the variables and nodes of the topology. | |
| Sequence< NodeId > | topologicalOrder () const |
| The topological order stays the same as long as no variable or arcs are added or erased src the topology. | |
Getter and setters | |
| const std::string & | property (const std::string &name) const |
| Return the value of the property name of this GraphicalModel. | |
| const std::string & | propertyWithDefault (const std::string &name, const std::string &byDefault) const |
| Return the value of the property name of this GraphicalModel. | |
| void | setProperty (const std::string &name, const std::string &value) |
| Add or change a property of this GraphicalModel. | |
| std::vector< std::string > | properties () const |
| List of all the properties. | |
Variable manipulation methods. | |
| virtual bool | empty () const |
| Return true if this graphical model is empty. | |
| std::vector< std::string > | names (const std::vector< NodeId > &ids) const |
| transform a vector of NodeId in a vector of names | |
| std::vector< std::string > | names (const NodeSet &ids) const |
| transform a NodeSet in a vector of names | |
| std::vector< NodeId > | ids (const std::vector< std::string > &names) const |
| transform a vector of names into a vector of nodeId | |
| NodeSet | nodeset (const std::vector< std::string > &names) const |
| transform a vector of names into a NodeSet | |
| gum::VariableSet | variables (const std::vector< std::string > &l) const |
| transform a vector of names into a VariableeSet | |
| gum::VariableSet | variables (const NodeSet &ids) const |
| transform a vector of NodeId into a VariableeSet | |
| Instantiation | completeInstantiation () const |
| Get an instantiation over all the variables of the model. | |
Static Public Member Functions | |
| static InfluenceDiagram< GUM_SCALAR > | fastPrototype (const std::string &dotlike, Size domainSize) |
| Create an Influence Diagram with a dot-like syntax which specifies: | |
| static InfluenceDiagram< GUM_SCALAR > | fastPrototype (const std::string &dotlike, const std::string &domain="[2]") |
| static void | spaceCplxToStream (std::stringstream &s, double dSize, int dim, Size usedMem) |
| send to the stream the space complexity with 3 parametrs | |
Protected Member Functions | |
| virtual void | moralGraph_ (UndiGraph &graph) const |
| Returns the moral graph of this InfluenceDiagram. | |
| void | removeTables_ () |
| Removing ancient table. | |
| void | copyStructureAndTables_ (const InfluenceDiagram< GUM_SCALAR > &IDsource) |
| Copying tables from another influence diagram. | |
| NodeId | addNode_ (const DiscreteVariable &variableType, NodeId DesiredId) |
| Add a node. | |
| Sequence< NodeId > | getChildrenDecision_ (NodeId parentDecision) const |
| Returns the list of children decision for a given nodeId. | |
Protected Attributes | |
| DAG | dag_ |
| The DAG of this Directed Graphical Model. | |
Private Member Functions | |
| const HashTable< std::string, std::string > & | _properties_ () const |
| Return the properties of this Directed Graphical Model. | |
Private Attributes | |
| VariableNodeMap | _variableMap_ |
| Mapping between id and variable. | |
| NodeProperty< Tensor< GUM_SCALAR > * > | _tensorMap_ |
| Mapping between tensor variable's id and their CPT. | |
| NodeProperty< Tensor< GUM_SCALAR > * > | _utilityMap_ |
| Mapping between utility variable's id and their utility table. | |
| List< NodeSet > | _temporalOrder_ |
| The temporal order. | |
| HashTable< std::string, std::string > | _propertiesMap_ |
| The properties of this Directed Graphical Model. | |
Class representing an Influence Diagram.
Definition at line 72 of file influenceDiagram.h.
| INLINE gum::InfluenceDiagram< GUM_SCALAR >::InfluenceDiagram | ( | ) |
Default constructor.
Definition at line 148 of file influenceDiagram_tpl.h.
References gum::DAGmodel::DAGmodel(), and InfluenceDiagram().
Referenced by InfluenceDiagram(), InfluenceDiagram(), ~InfluenceDiagram(), copyStructureAndTables_(), operator!=(), operator=(), and operator==().
|
override |
Destructor.
Definition at line 156 of file influenceDiagram_tpl.h.
References InfluenceDiagram(), and removeTables_().
| gum::InfluenceDiagram< GUM_SCALAR >::InfluenceDiagram | ( | const InfluenceDiagram< GUM_SCALAR > & | source | ) |
Copy Constructor.
Definition at line 165 of file influenceDiagram_tpl.h.
References InfluenceDiagram(), and copyStructureAndTables_().
|
privateinherited |
Return the properties of this Directed Graphical Model.
Definition at line 70 of file graphicalModel_inl.h.
References _propertiesMap_.
Referenced by property().
| 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 Tensor 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 431 of file influenceDiagram_tpl.h.
References addChanceNode().
| NodeId gum::InfluenceDiagram< GUM_SCALAR >::add | ( | const std::string & | fast_description, |
| unsigned int | default_nbrmod = 2 ) |
Add a chance, a decision or an utility variable from a description in "fast" syntax.
| fast_description( | str) following "fast" syntax description |
| default_nbrmod( | int) nbr of modality if fast_description do not indicate it. default_nbrmod=1 is the way to create a variable with only one value (for instance for reward in influence diagram). |
| DuplicateLabel | Raised if variable.name() is already used in this gum::InfluenceDiagram. |
| NotAllowed | if nbrmod<2 |
Definition at line 876 of file influenceDiagram_tpl.h.
References addChanceNode(), addDecisionNode(), and addUtilityNode().
|
inline |
Add an arc in the ID, and update diagram's tensor 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 449 of file influenceDiagram.h.
References addArc(), and idFromName().
| INLINE void gum::InfluenceDiagram< GUM_SCALAR >::addArc | ( | NodeId | tail, |
| NodeId | head ) |
Add an arc in the ID, and update diagram's tensor 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 600 of file influenceDiagram_tpl.h.
References _tensorMap_, _utilityMap_, gum::DAGmodel::dag_, GUM_ERROR, isChanceNode(), isUtilityNode(), and variable().
Referenced by gum::InfluenceDiagramGenerator< GUM_SCALAR >::_checkTemporalOrder_(), addArc(), copyStructureAndTables_(), and fastPrototype().
| 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 tensor. |
| id | The chosen id. If 0, the NodeGraphPart will choose. |
| DuplicateElement | if id(<>0) is already used |
Definition at line 490 of file influenceDiagram_tpl.h.
References _tensorMap_, addNode_(), and variable().
| 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 Tensor 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 470 of file influenceDiagram_tpl.h.
References addChanceNode().
Referenced by add(), add(), addChanceNode(), addChanceNode(), gum::build_node_for_ID(), and copyStructureAndTables_().
| NodeId gum::InfluenceDiagram< GUM_SCALAR >::addChanceNode | ( | const std::string & | fast_description, |
| unsigned int | default_nbrmod = 2 ) |
Add a chance variable from a description in "fast" syntax.
| fast_description( | str) following "fast" syntax description |
| default_nbrmod( | int) nbr of modality if fast_description do not indicate it. default_nbrmod=1 is the way to create a variable with only one value (for instance for reward in influence diagram). |
| DuplicateLabel | Raised if variable.name() is already used in this gum::InfluenceDiagram. |
| NotAllowed | if nbrmod<2 |
Definition at line 851 of file influenceDiagram_tpl.h.
References addChanceNode(), gum::fastVariable(), and GUM_ERROR.
| 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 460 of file influenceDiagram_tpl.h.
References addNode_().
Referenced by add(), addDecisionNode(), gum::build_node_for_ID(), and copyStructureAndTables_().
| NodeId gum::InfluenceDiagram< GUM_SCALAR >::addDecisionNode | ( | const std::string & | fast_description, |
| unsigned int | default_nbrmod = 2 ) |
Add a decision variable from a description in "fast" syntax.
| fast_description( | str) following "fast" syntax description |
| default_nbrmod( | int) nbr of modality if fast_description do not indicate it. |
| DuplicateLabel | Raised if variable.name() is already used in this gum::InfluenceDiagram. |
| NotAllowed | if nbrmod<2 |
Definition at line 868 of file influenceDiagram_tpl.h.
References addDecisionNode(), gum::fastVariable(), and GUM_ERROR.
|
protected |
Add a node.
Definition at line 533 of file influenceDiagram_tpl.h.
References _variableMap_, and gum::DAGmodel::dag_.
Referenced by addChanceNode(), addDecisionNode(), and addUtilityNode().
| 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 509 of file influenceDiagram_tpl.h.
References _utilityMap_, addNode_(), gum::DiscreteVariable::domainSize(), GUM_ERROR, and variable().
| 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 441 of file influenceDiagram_tpl.h.
References addUtilityNode().
Referenced by add(), addUtilityNode(), addUtilityNode(), gum::build_node_for_ID(), and copyStructureAndTables_().
| NodeId gum::InfluenceDiagram< GUM_SCALAR >::addUtilityNode | ( | const std::string & | fast_description | ) |
Add a utility variable from a description in "fast" syntax with only one value.
| fast_description( | str) following "fast" syntax description |
Definition at line 859 of file influenceDiagram_tpl.h.
References addUtilityNode(), gum::fastVariable(), and GUM_ERROR.
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 123 of file DAGmodel_inl.h.
References gum::ArcGraphPart::ancestors(), and dag().
Referenced by ancestors().
|
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 125 of file DAGmodel_inl.h.
References ancestors(), and gum::GraphicalModel::idFromName().
|
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 65 of file DAGmodel_inl.h.
References dag_.
Referenced by hasSameStructure(), gum::MarkovBlanket::hasSameStructure(), and gum::BayesNetFragment< GUM_SCALAR >::toBN().
| void gum::InfluenceDiagram< GUM_SCALAR >::beginTopologyTransformation | ( | ) |
When inserting/removing arcs, node CPTs/utilities change their dimension with a cost in time.
begin Multiple Change for all CPTs
These functions delay the CPTs change to be done just once at the end of a* sequence of topology modification. begins a sequence of insertions/deletions of arcs without changing the dimensions of the CPTs.
Definition at line 888 of file influenceDiagram_tpl.h.
References _tensorMap_, _utilityMap_, isChanceNode(), isUtilityNode(), and gum::DAGmodel::nodes().
| INLINE Size gum::InfluenceDiagram< GUM_SCALAR >::chanceNodeSize | ( | ) | const |
Returns the number of chance nodes.
Definition at line 376 of file influenceDiagram_tpl.h.
References _tensorMap_.
Referenced by toString().
|
inline |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 428 of file influenceDiagram.h.
References changeVariableName(), and idFromName().
| 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 588 of file influenceDiagram_tpl.h.
References _variableMap_.
Referenced by changeVariableName().
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 87 of file DAGmodel_inl.h.
References dag_.
Referenced by gum::BayesNet< GUM_SCALAR >::erase(), gum::prm::ClassBayesNet< GUM_SCALAR >::toDot(), and gum::prm::InstanceBayesNet< GUM_SCALAR >::toDot().
returns the children of a set of nodes
Definition at line 93 of file DAGmodel_inl.h.
References dag_, and gum::GraphicalModel::ids().
|
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 89 of file DAGmodel_inl.h.
References dag_, and gum::GraphicalModel::idFromName().
|
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 95 of file DAGmodel_inl.h.
References gum::GraphicalModel::names().
| void gum::InfluenceDiagram< GUM_SCALAR >::clear | ( | ) |
Referenced by getPartialTemporalOrder(), and operator=().
|
inherited |
Get an instantiation over all the variables of the model.
Definition at line 106 of file graphicalModel_inl.h.
References nodes().
|
protected |
Copying tables from another influence diagram.
Definition at line 210 of file influenceDiagram_tpl.h.
References InfluenceDiagram(), addArc(), addChanceNode(), addDecisionNode(), addUtilityNode(), cpt(), isChanceNode(), isUtilityNode(), gum::Variable::name(), gum::DAGmodel::nodes(), gum::DAGmodel::parents(), gum::DAGmodel::size(), utility(), and variable().
Referenced by InfluenceDiagram(), and operator=().
|
virtual |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 324 of file influenceDiagram_tpl.h.
References _tensorMap_.
Referenced by copyStructureAndTables_(), cpt(), fastPrototype(), operator==(), and removeTables_().
|
inlinefinalvirtual |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 158 of file influenceDiagram.h.
References cpt(), and idFromName().
|
inherited |
Returns a constant reference to the dag of this Bayes Net.
Definition at line 57 of file DAGmodel_inl.h.
References dag_.
Referenced by gum::BayesNetFragment< GUM_SCALAR >::BayesNetFragment(), gum::MarginalTargetedInference< GUM_SCALAR >::MarginalTargetedInference(), gum::BayesNet< GUM_SCALAR >::add(), ancestors(), gum::IBayesNet< double >::arcs(), descendants(), gum::BayesNetFragment< GUM_SCALAR >::installCPT(), isIndependent(), isIndependent(), gum::BayesNetFragment< GUM_SCALAR >::isInstalledNode(), moralGraph(), moralizedAncestralGraph(), gum::BayesBall::relevantTensors(), gum::dSeparationAlgorithm::relevantTensors(), gum::BayesNet< GUM_SCALAR >::reverseArc(), size(), gum::BayesNetFragment< GUM_SCALAR >::toBN(), gum::BayesNetFragment< GUM_SCALAR >::toDot(), gum::IBayesNet< GUM_SCALAR >::toString(), gum::InfluenceDiagram< GUM_SCALAR >::toString(), and gum::BayesNetFragment< GUM_SCALAR >::whenArcDeleted().
| INLINE Size gum::InfluenceDiagram< GUM_SCALAR >::decisionNodeSize | ( | ) | const |
Returns the number of decision nodes.
Definition at line 384 of file influenceDiagram_tpl.h.
References _tensorMap_, _utilityMap_, and gum::DAGmodel::size().
Referenced by toString().
| 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 797 of file influenceDiagram_tpl.h.
References decisionOrderExists(), GUM_ERROR, isDecisionNode(), and gum::DAGmodel::topologicalOrder().
Referenced by getPartialTemporalOrder().
| bool gum::InfluenceDiagram< GUM_SCALAR >::decisionOrderExists | ( | ) | const |
True if a directed path exist with all decision nodes.
Definition at line 672 of file influenceDiagram_tpl.h.
References gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::begin(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::end(), existsPathBetween(), isDecisionNode(), and gum::DAGmodel::topologicalOrder().
Referenced by gum::InfluenceDiagramGenerator< GUM_SCALAR >::_checkTemporalOrder_(), and decisionOrder().
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 117 of file DAGmodel_inl.h.
References dag(), and gum::ArcGraphPart::descendants().
Referenced by descendants().
|
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 119 of file DAGmodel_inl.h.
References descendants(), and gum::GraphicalModel::idFromName().
|
virtualinherited |
Return true if this graphical model is empty.
Definition at line 116 of file graphicalModel_inl.h.
References size().
Referenced by gum::IBayesNet< GUM_SCALAR >::check(), and gum::BayesNet< GUM_SCALAR >::clear().
| void gum::InfluenceDiagram< GUM_SCALAR >::endTopologyTransformation | ( | ) |
terminates a sequence of insertions/deletions of arcs by adjusting all CPTs/utilities dimensions.
end Multiple Change for all CPTs
Definition at line 896 of file influenceDiagram_tpl.h.
References _tensorMap_, _utilityMap_, isChanceNode(), isUtilityNode(), and gum::DAGmodel::nodes().
| 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 581 of file influenceDiagram_tpl.h.
References _variableMap_, and erase().
|
inline |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 411 of file influenceDiagram.h.
References erase(), and idFromName().
Referenced by erase().
| 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 555 of file influenceDiagram_tpl.h.
References _tensorMap_, _utilityMap_, _variableMap_, gum::DAGmodel::dag_, isChanceNode(), isUtilityNode(), and variable().
Referenced by erase().
| INLINE void gum::InfluenceDiagram< GUM_SCALAR >::eraseArc | ( | const Arc & | arc | ) |
Removes an arc in the ID, and update diagram's tensor nodes cpt if necessary.
If (tail, head) doesn't exist, the nothing happens.
| arc | The arc removed. |
Definition at line 620 of file influenceDiagram_tpl.h.
References _tensorMap_, _utilityMap_, gum::DAGmodel::dag_, gum::Arc::head(), isChanceNode(), isUtilityNode(), gum::Arc::tail(), and variable().
Referenced by eraseArc(), and eraseArc().
|
inline |
Add an arc in the ID, and update diagram's tensor 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 472 of file influenceDiagram.h.
References eraseArc(), and idFromName().
| INLINE void gum::InfluenceDiagram< GUM_SCALAR >::eraseArc | ( | NodeId | tail, |
| NodeId | head ) |
Removes an arc in the ID, and update diagram's tensor nodes cpt if necessary.
If (tail, head) doesn't exist, the nothing happens.
| head | and |
| tail | as NodeId |
Definition at line 641 of file influenceDiagram_tpl.h.
References eraseArc().
|
finalvirtualinherited |
Returns a constant reference to the dag of this Bayes Net.
Implements gum::GraphicalModel.
Definition at line 107 of file DAGmodel_inl.h.
Return true if this node exists in this graphical model.
Implements gum::GraphicalModel.
Definition at line 105 of file DAGmodel_inl.h.
References dag_.
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 67 of file DAGmodel_inl.h.
References dag_.
Referenced by existsArc(), gum::BayesNet< GUM_SCALAR >::reverseArc(), gum::BayesNetFragment< GUM_SCALAR >::toDot(), and gum::BayesNetFragment< GUM_SCALAR >::whenArcDeleted().
|
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 71 of file DAGmodel_inl.h.
References existsArc(), and gum::GraphicalModel::idFromName().
|
inline |
True if a directed path exist with all decision nodes.
Definition at line 504 of file influenceDiagram.h.
References existsPathBetween(), and idFromName().
| bool gum::InfluenceDiagram< GUM_SCALAR >::existsPathBetween | ( | NodeId | src, |
| NodeId | dest ) const |
Returns true if a path exists between two nodes.
Definition at line 704 of file influenceDiagram_tpl.h.
References gum::DAGmodel::dag_, gum::List< Val >::empty(), gum::List< Val >::front(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
Referenced by decisionOrderExists(), and existsPathBetween().
returns the parents of a node and the 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 |
Implements gum::GraphicalModel.
Definition at line 81 of file DAGmodel_inl.h.
References dag_.
|
finalvirtualinherited |
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 |
Implements gum::GraphicalModel.
Definition at line 83 of file DAGmodel_inl.h.
References dag_, and gum::GraphicalModel::idFromName().
|
static |
Definition at line 104 of file influenceDiagram_tpl.h.
References addArc(), gum::build_node_for_ID(), cpt(), isChanceNode(), isUtilityNode(), gum::DAGmodel::nodes(), gum::remove_newline(), gum::GraphicalModel::setProperty(), gum::split(), and utility().
|
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 98 of file influenceDiagram_tpl.h.
References fastPrototype().
Referenced by fastPrototype().
|
protected |
Returns the list of children decision for a given nodeId.
Definition at line 761 of file influenceDiagram_tpl.h.
References gum::DAGmodel::dag_, gum::List< Val >::empty(), gum::List< Val >::front(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::insert(), isDecisionNode(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
Referenced by getDecisionGraph().
| gum::DAG * gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph | ( | ) | const |
Returns the temporal Graph.
Definition at line 738 of file influenceDiagram_tpl.h.
References gum::DAGmodel::dag_, getChildrenDecision_(), and isDecisionNode().
| 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 813 of file influenceDiagram_tpl.h.
References _temporalOrder_, clear(), gum::Set< Key >::contains(), gum::DAGmodel::dag_, decisionOrder(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::Set< Key >::insert(), and isChanceNode().
Definition at line 66 of file DAGmodel.cpp.
References DAGmodel(), arcs(), gum::Set< Key >::exists(), gum::GraphicalModel::idFromName(), nodes(), size(), sizeArcs(), and gum::GraphicalModel::variable().
|
finalvirtual |
Getter by name.
| NotFound | if no such name exists in the graph. |
Implements gum::GraphicalModel.
Definition at line 415 of file influenceDiagram_tpl.h.
References _variableMap_.
Referenced by addArc(), gum::build_node_for_ID(), changeVariableName(), cpt(), erase(), eraseArc(), existsPathBetween(), isChanceNode(), isDecisionNode(), isUtilityNode(), operator==(), utility(), and variable().
|
inherited |
transform a vector of names into a vector of nodeId
Definition at line 139 of file graphicalModel_inl.h.
References names().
Referenced by gum::DAGmodel::children(), exists(), names(), and gum::DAGmodel::parents().
|
inline |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 197 of file influenceDiagram.h.
References idFromName(), and isChanceNode().
Referenced by isChanceNode().
| INLINE bool gum::InfluenceDiagram< GUM_SCALAR >::isChanceNode | ( | NodeId | varId | ) | const |
Returns true if node is a chance one.
Definition at line 360 of file influenceDiagram_tpl.h.
References _tensorMap_.
Referenced by addArc(), beginTopologyTransformation(), copyStructureAndTables_(), endTopologyTransformation(), erase(), eraseArc(), fastPrototype(), getPartialTemporalOrder(), isDecisionNode(), moralGraph_(), operator==(), removeTables_(), and toDot().
|
inline |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 190 of file influenceDiagram.h.
References idFromName(), and isDecisionNode().
Referenced by isDecisionNode().
| INLINE bool gum::InfluenceDiagram< GUM_SCALAR >::isDecisionNode | ( | NodeId | varId | ) | const |
Returns true if node is a decision one.
Definition at line 348 of file influenceDiagram_tpl.h.
References isChanceNode(), and isUtilityNode().
Referenced by gum::InfluenceDiagramGenerator< GUM_SCALAR >::_checkTemporalOrder_(), decisionOrder(), decisionOrderExists(), getChildrenDecision_(), getDecisionGraph(), moralGraph_(), operator==(), and toDot().
|
finalvirtualinherited |
check if nodes X and nodes Y are independent given nodes Z
Implements gum::GraphicalModel.
Definition at line 142 of file DAGmodel_inl.h.
References dag(), and gum::DAG::dSeparation().
|
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 202 of file DAGmodel.h.
References gum::GraphicalModel::idFromName(), isIndependent(), and gum::GraphicalModel::nodeset().
|
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 208 of file DAGmodel.h.
References isIndependent(), and gum::GraphicalModel::nodeset().
|
finalvirtualinherited |
check if node X and node Y are independent given nodes Z
Implements gum::GraphicalModel.
Definition at line 138 of file DAGmodel_inl.h.
References dag(), and gum::DAG::dSeparation().
Referenced by isIndependent(), and isIndependent().
|
inline |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 183 of file influenceDiagram.h.
References idFromName(), isUtilityNode(), and isUtilityNode().
Referenced by isUtilityNode().
| INLINE bool gum::InfluenceDiagram< GUM_SCALAR >::isUtilityNode | ( | NodeId | varId | ) | const |
Returns true if node is a utility one.
Definition at line 340 of file influenceDiagram_tpl.h.
References _utilityMap_.
Referenced by addArc(), beginTopologyTransformation(), copyStructureAndTables_(), endTopologyTransformation(), erase(), eraseArc(), fastPrototype(), isDecisionNode(), isUtilityNode(), moralGraph_(), operator==(), removeTables_(), and toDot().
|
inherited |
Definition at line 95 of file graphicalModel_inl.h.
References nodes().
Referenced by gum::IBayesNet< GUM_SCALAR >::toString(), gum::IMarkovRandomField< GUM_SCALAR >::toString(), and gum::InfluenceDiagram< GUM_SCALAR >::toString().
|
inherited |
Definition at line 150 of file DAGmodel_inl.h.
References dag_.
|
inherited |
Definition at line 154 of file DAGmodel_inl.h.
|
inherited |
Definition at line 159 of file DAGmodel_inl.h.
|
inherited |
Definition at line 146 of file DAGmodel_inl.h.
|
inherited |
The node's id are coherent with the variables and nodes of the topology.
Definition at line 64 of file DAGmodel.cpp.
References dag(), and gum::DAG::moralGraph().
Referenced by gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), and gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_().
|
protectedvirtual |
Returns the moral graph of this InfluenceDiagram.
Definition at line 653 of file influenceDiagram_tpl.h.
References gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNodeWithId(), gum::DAGmodel::dag_, isChanceNode(), isDecisionNode(), and isUtilityNode().
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 134 of file DAGmodel_inl.h.
References dag(), gum::DAG::moralizedAncestralGraph(), and nodes().
Referenced by moralizedAncestralGraph().
|
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 130 of file DAGmodel_inl.h.
References moralizedAncestralGraph(), and gum::GraphicalModel::nodeset().
|
inherited |
transform a NodeSet in a vector of names
Definition at line 129 of file graphicalModel_inl.h.
|
inherited |
transform a vector of NodeId in a vector of names
Definition at line 119 of file graphicalModel_inl.h.
References ids(), and variableNodeMap().
Referenced by gum::DAGmodel::children(), exists(), ids(), nodeset(), and gum::DAGmodel::parents().
|
finalvirtual |
Return id node from discrete var pointer.
| NotFound | If no variable matches var. |
Implements gum::GraphicalModel.
Definition at line 409 of file influenceDiagram_tpl.h.
References _variableMap_.
|
finalvirtualinherited |
Returns a constant reference to the dag of this Bayes Net.
Implements gum::GraphicalModel.
Definition at line 113 of file DAGmodel_inl.h.
References dag_.
Referenced by gum::Estimator< GUM_SCALAR >::Estimator(), gum::BayesNetFragment< GUM_SCALAR >::~BayesNetFragment(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::_verticesSampling_(), gum::BayesNet< GUM_SCALAR >::beginTopologyTransformation(), gum::InfluenceDiagram< GUM_SCALAR >::beginTopologyTransformation(), gum::IBayesNet< GUM_SCALAR >::check(), gum::BayesNetFragment< GUM_SCALAR >::checkConsistency(), gum::BayesNet< GUM_SCALAR >::clear(), gum::InfluenceDiagram< GUM_SCALAR >::copyStructureAndTables_(), gum::IBayesNet< GUM_SCALAR >::dim(), gum::BayesNet< GUM_SCALAR >::endTopologyTransformation(), gum::InfluenceDiagram< GUM_SCALAR >::endTopologyTransformation(), gum::InfluenceDiagram< GUM_SCALAR >::fastPrototype(), gum::BayesNet< GUM_SCALAR >::generateCPTs(), gum::getMaxModality(), hasSameStructure(), gum::IBayesNet< GUM_SCALAR >::jointProbability(), gum::IBayesNet< GUM_SCALAR >::maxNonOneParam(), gum::IBayesNet< GUM_SCALAR >::maxParam(), gum::IBayesNet< GUM_SCALAR >::maxVarDomainSize(), gum::IBayesNet< GUM_SCALAR >::memoryFootprint(), gum::IBayesNet< GUM_SCALAR >::minNonZeroParam(), gum::IBayesNet< GUM_SCALAR >::minParam(), gum::prm::ClassBayesNet< GUM_SCALAR >::modalities(), gum::prm::InstanceBayesNet< GUM_SCALAR >::modalities(), moralizedAncestralGraph(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::Estimator< GUM_SCALAR >::setFromBN(), gum::BayesNetFragment< GUM_SCALAR >::toBN(), gum::prm::ClassBayesNet< GUM_SCALAR >::toDot(), gum::prm::InstanceBayesNet< GUM_SCALAR >::toDot(), and gum::ImportanceSampling< GUM_SCALAR >::unsharpenBN_().
|
inherited |
transform a vector of names into a NodeSet
Definition at line 60 of file graphicalModel.cpp.
References idFromName(), gum::Set< Key >::insert(), and names().
Referenced by gum::IBayesNet< double >::children(), gum::IBayesNet< double >::children(), gum::DAGmodel::isIndependent(), gum::DAGmodel::isIndependent(), gum::UGmodel::isIndependent(), gum::UGmodel::isIndependent(), gum::DAGmodel::moralizedAncestralGraph(), and gum::DAGmodel::parents().
|
inline |
Definition at line 135 of file influenceDiagram.h.
References InfluenceDiagram(), and operator==().
| InfluenceDiagram< GUM_SCALAR > & gum::InfluenceDiagram< GUM_SCALAR >::operator= | ( | const InfluenceDiagram< GUM_SCALAR > & | source | ) |
Copy Operator.
Definition at line 175 of file influenceDiagram_tpl.h.
References InfluenceDiagram(), clear(), and copyStructureAndTables_().
| bool gum::InfluenceDiagram< GUM_SCALAR >::operator== | ( | const InfluenceDiagram< GUM_SCALAR > & | other | ) | const |
Definition at line 903 of file influenceDiagram_tpl.h.
References InfluenceDiagram(), gum::Instantiation::chgVal(), cpt(), gum::MultiDimDecorator< GUM_SCALAR >::domainSize(), gum::Instantiation::end(), gum::MultiDimDecorator< GUM_SCALAR >::get(), idFromName(), gum::Instantiation::inc(), gum::BijectionImplementation< T1, T2, Gen >::insert(), isChanceNode(), isDecisionNode(), isUtilityNode(), gum::MultiDimDecorator< GUM_SCALAR >::nbrDim(), gum::DAGmodel::nodes(), gum::BijectionImplementation< T1, T2, Gen >::second(), gum::Instantiation::setFirst(), gum::DAGmodel::size(), gum::DAGmodel::sizeArcs(), utility(), gum::Instantiation::val(), variable(), gum::Instantiation::variable(), and variableFromName().
Referenced by operator!=().
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 75 of file DAGmodel_inl.h.
References dag_.
Referenced by gum::IBayesNet< GUM_SCALAR >::check(), gum::BayesNetFragment< GUM_SCALAR >::checkConsistency(), gum::InfluenceDiagram< GUM_SCALAR >::copyStructureAndTables_(), gum::BayesNetFragment< GUM_SCALAR >::installCPT(), gum::BayesNetFragment< GUM_SCALAR >::installCPT_(), parents(), parents(), gum::prm::ClassBayesNet< GUM_SCALAR >::toDot(), and gum::prm::InstanceBayesNet< GUM_SCALAR >::toDot().
returns the parents of a set of nodes
Definition at line 99 of file DAGmodel_inl.h.
References dag_, and gum::GraphicalModel::ids().
|
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 77 of file DAGmodel_inl.h.
References gum::GraphicalModel::idFromName(), and parents().
|
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 101 of file DAGmodel_inl.h.
References gum::GraphicalModel::names(), gum::GraphicalModel::nodeset(), and parents().
|
inherited |
List of all the properties.
Definition at line 81 of file graphicalModel_inl.h.
References _propertiesMap_.
|
inherited |
Return the value of the property name of this GraphicalModel.
| NotFound | Raised if no name property is found. |
Definition at line 60 of file graphicalModel_inl.h.
References _properties_(), and GUM_ERROR.
Referenced by gum::IMarkovRandomField< GUM_SCALAR >::toDot(), gum::InfluenceDiagram< GUM_SCALAR >::toDot(), and gum::IMarkovRandomField< GUM_SCALAR >::toDotAsFactorGraph().
|
inherited |
Return the value of the property name of this GraphicalModel.
return byDefault if the property name is not found
Definition at line 75 of file graphicalModel_inl.h.
References _propertiesMap_.
|
protected |
Removing ancient table.
Definition at line 199 of file influenceDiagram_tpl.h.
References cpt(), gum::DAGmodel::dag_, isChanceNode(), isUtilityNode(), and utility().
Referenced by ~InfluenceDiagram().
|
inherited |
Add or change a property of this GraphicalModel.
Definition at line 89 of file graphicalModel_inl.h.
References _propertiesMap_.
Referenced by gum::IBayesNet< GUM_SCALAR >::IBayesNet(), gum::IMarkovRandomField< GUM_SCALAR >::IMarkovRandomField(), and gum::InfluenceDiagram< GUM_SCALAR >::fastPrototype().
|
finalvirtualinherited |
Returns the number of variables in this Directed Graphical Model.
Implements gum::GraphicalModel.
Definition at line 60 of file DAGmodel_inl.h.
References dag(), and gum::NodeGraphPart::size().
Referenced by gum::InfluenceDiagram< GUM_SCALAR >::copyStructureAndTables_(), gum::InfluenceDiagram< GUM_SCALAR >::decisionNodeSize(), hasSameStructure(), gum::MarkovBlanket::hasSameStructure(), gum::IBayesNet< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::prm::ClassBayesNet< GUM_SCALAR >::toDot(), gum::prm::InstanceBayesNet< GUM_SCALAR >::toDot(), and gum::IBayesNet< GUM_SCALAR >::toString().
|
inherited |
Returns the number of arcs in this Directed Graphical Model.
Definition at line 63 of file DAGmodel_inl.h.
References dag_.
Referenced by hasSameStructure(), gum::MarkovBlanket::hasSameStructure(), and gum::InfluenceDiagram< GUM_SCALAR >::operator==().
|
staticinherited |
send to the stream the space complexity with 3 parametrs
| s | the stream |
| dSize | the log10domainSize |
| dim | the dimension |
| usedMem | the memory needed for the params |
Definition at line 69 of file graphicalModel.cpp.
Referenced by gum::IBayesNet< GUM_SCALAR >::toString().
| std::string gum::InfluenceDiagram< GUM_SCALAR >::toDot | ( | ) | const |
Definition at line 246 of file influenceDiagram_tpl.h.
References gum::DAGmodel::dag_, isChanceNode(), isDecisionNode(), isUtilityNode(), gum::GraphicalModel::property(), and variable().
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 115 of file DAGmodel_inl.h.
Referenced by gum::InfluenceDiagramGenerator< GUM_SCALAR >::_checkTemporalOrder_(), gum::InfluenceDiagram< GUM_SCALAR >::decisionOrder(), and gum::InfluenceDiagram< GUM_SCALAR >::decisionOrderExists().
| std::string gum::InfluenceDiagram< GUM_SCALAR >::toString | ( | ) | const |
Definition at line 298 of file influenceDiagram_tpl.h.
References chanceNodeSize(), gum::DAGmodel::dag(), decisionNodeSize(), gum::GraphicalModel::log10DomainSize(), and utilityNodeSize().
|
virtual |
Returns the utility table of a utility node.
| NotFound | If no variable's id matches varId. |
Definition at line 332 of file influenceDiagram_tpl.h.
References _utilityMap_.
Referenced by copyStructureAndTables_(), fastPrototype(), operator==(), removeTables_(), and utility().
|
inlinefinalvirtual |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 168 of file influenceDiagram.h.
References idFromName(), and utility().
| INLINE Size gum::InfluenceDiagram< GUM_SCALAR >::utilityNodeSize | ( | ) | const |
Returns the number of utility nodes.
Definition at line 368 of file influenceDiagram_tpl.h.
References _utilityMap_.
Referenced by toString().
|
inline |
Returns the CPT of a tensor variable.
| NotFound | If no variable's id matches varId. |
Definition at line 220 of file influenceDiagram.h.
References idFromName(), and variable().
|
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 401 of file influenceDiagram_tpl.h.
References _variableMap_.
Referenced by addArc(), addChanceNode(), addUtilityNode(), copyStructureAndTables_(), erase(), eraseArc(), operator==(), toDot(), and variable().
|
finalvirtual |
Getter by name.
| NotFound | if no such name exists in the graph. |
Implements gum::GraphicalModel.
Definition at line 422 of file influenceDiagram_tpl.h.
References _variableMap_.
Referenced by operator==().
|
finalvirtual |
Returns a constant reference to the VariableNodeMap of this Influence Diagram.
Implements gum::GraphicalModel.
Definition at line 393 of file influenceDiagram_tpl.h.
References _variableMap_.
|
inherited |
transform a vector of NodeId into a VariableeSet
Definition at line 160 of file graphicalModel_inl.h.
References gum::VariableNodeMap::get(), gum::Set< Key >::insert(), and variableNodeMap().
|
inherited |
transform a vector of names into a VariableeSet
Definition at line 150 of file graphicalModel_inl.h.
References variableNodeMap().
|
privateinherited |
The properties of this Directed Graphical Model.
Definition at line 236 of file graphicalModel.h.
Referenced by _properties_(), operator=(), properties(), propertyWithDefault(), and setProperty().
|
mutableprivate |
The temporal order.
Definition at line 565 of file influenceDiagram.h.
Referenced by getPartialTemporalOrder().
|
private |
Mapping between tensor variable's id and their CPT.
Definition at line 560 of file influenceDiagram.h.
Referenced by addArc(), addChanceNode(), beginTopologyTransformation(), chanceNodeSize(), cpt(), decisionNodeSize(), endTopologyTransformation(), erase(), eraseArc(), and isChanceNode().
|
private |
Mapping between utility variable's id and their utility table.
Definition at line 562 of file influenceDiagram.h.
Referenced by addArc(), addUtilityNode(), beginTopologyTransformation(), decisionNodeSize(), endTopologyTransformation(), erase(), eraseArc(), isUtilityNode(), utility(), and utilityNodeSize().
|
private |
Mapping between id and variable.
Definition at line 557 of file influenceDiagram.h.
Referenced by addNode_(), changeVariableName(), erase(), erase(), idFromName(), nodeId(), variable(), variableFromName(), and variableNodeMap().
|
protectedinherited |
The DAG of this Directed Graphical Model.
Definition at line 272 of file DAGmodel.h.
Referenced by DAGmodel(), gum::prm::ClassBayesNet< GUM_SCALAR >::_get_(), gum::prm::ClassBayesNet< GUM_SCALAR >::_init_(), gum::prm::InstanceBayesNet< GUM_SCALAR >::_init_(), gum::BayesNet< GUM_SCALAR >::add(), gum::BayesNet< GUM_SCALAR >::addArc(), gum::InfluenceDiagram< GUM_SCALAR >::addArc(), gum::InfluenceDiagram< GUM_SCALAR >::addNode_(), arcs(), children(), children(), children(), dag(), gum::BayesNet< GUM_SCALAR >::erase(), gum::InfluenceDiagram< GUM_SCALAR >::erase(), gum::BayesNet< GUM_SCALAR >::eraseArc(), gum::InfluenceDiagram< GUM_SCALAR >::eraseArc(), exists(), existsArc(), gum::InfluenceDiagram< GUM_SCALAR >::existsPathBetween(), family(), family(), gum::InfluenceDiagram< GUM_SCALAR >::getChildrenDecision_(), gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph(), gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder(), gum::BayesNetFragment< GUM_SCALAR >::installArc_(), gum::BayesNetFragment< GUM_SCALAR >::installNode(), minimalCondSet(), gum::InfluenceDiagram< GUM_SCALAR >::moralGraph_(), nodes(), operator=(), parents(), parents(), gum::InfluenceDiagram< GUM_SCALAR >::removeTables_(), sizeArcs(), gum::InfluenceDiagram< GUM_SCALAR >::toDot(), gum::BayesNetFragment< GUM_SCALAR >::uninstallArc_(), and gum::BayesNetFragment< GUM_SCALAR >::uninstallNode().