28 #ifndef GUM_INF_DIAG_H 29 #define GUM_INF_DIAG_H 51 template <
typename GUM_SCALAR >
85 std::string
toDot()
const;
virtual const VariableNodeMap & variableNodeMap() const
Returns a constant reference to the VariableNodeMap of this Influence Diagram.
aGrUM's Potential is a multi-dimensional array with tensor operators.
NodeProperty< Potential< GUM_SCALAR > *> __potentialMap
Mapping between potential variable's id and their CPT.
Virtual base class for PGMs using a DAG.
void addArc(NodeId tail, NodeId head)
Add an arc in the ID, and update diagram's potential nodes cpt if necessary.
bool isChanceNode(NodeId varId) const
Returns true if node is a chance one.
void erase(NodeId id)
Erase a Variable from the network and remove the variable from all his childs.
NodeId addChanceNode(const DiscreteVariable &variable, NodeId id=0)
Add a chance variable, it's associate node and it's CPT.
virtual const DiscreteVariable & variable(NodeId id) const
Returns a constant reference over a variabe given it's node id.
bool existsPathBetween(NodeId src, NodeId dest) const
Returns true if a path exists between two nodes.
std::string toString() const
gum::DAG * getDecisionGraph() const
Returns the temporal Graph.
Container used to map discrete variables with nodes.
Size decisionNodeSize() const
Returns the number of decision nodes.
virtual const Potential< GUM_SCALAR > & utility(NodeId varId) const
Returns the utility table of a utility node.
virtual const DiscreteVariable & variableFromName(const std::string &name) const
Getter by name.
void changeVariableName(NodeId id, const std::string &new_name)
we allow the user to change the name of a variable
Size chanceNodeSize() const
Returns the number of chance nodes.
std::vector< NodeId > * getDecisionOrder() const
Returns the sequence of decision nodes in the directed path.
VariableNodeMap __variableMap
Mapping between id and variable.
Base class for discrete random variable.
Generic doubly linked lists.
gum is the global namespace for all aGrUM entities
Size utilityNodeSize() const
Returns the number of utility nodes.
NodeProperty< Potential< GUM_SCALAR > *> __utilityMap
Mapping between utility variable's id and their utility table.
NodeId _addNode(const DiscreteVariable &variableType, NodeId DesiredId)
Add a node.
The class for generic Hash Tables.
std::string toDot() const
const List< NodeSet > & getPartialTemporalOrder(bool clear=true) const
Returns partial temporal ordering.
bool isDecisionNode(NodeId varId) const
Returns true if node is a decision one.
Header of the Potential class.
bool isUtilityNode(NodeId varId) const
Returns true if node is a utility one.
List< NodeSet > __temporalOrder
The temporal order.
Class representing probabilistic DAG model.
The base class for all directed edgesThis class is used as a basis for manipulating all directed edge...
void _copyTables(const InfluenceDiagram< GUM_SCALAR > &IDsource)
Copying tables from another influence diagram.
virtual ~InfluenceDiagram()
Destructor.
Sequence< NodeId > _getChildrenDecision(NodeId parentDecision) const
Returns the list of children decision for a given nodeId.
bool decisionOrderExists() const
True if a directed path exist with all decison nodes.
virtual void _moralGraph(UndiGraph &graph) const
Returns the moral graph of this InfluenceDiagram.
virtual NodeId idFromName(const std::string &name) const
Getter by name.
InfluenceDiagram< GUM_SCALAR > & operator=(const InfluenceDiagram< GUM_SCALAR > &source)
Copy Operator.
void eraseArc(const Arc &arc)
Removes an arc in the ID, and update diagram's potential nodes cpt if necessary.
NodeId addUtilityNode(const DiscreteVariable &variable, NodeId id=0)
Add a utility variable, it's associate node and it's UT.
Base class for undirected graphs.
InfluenceDiagram()
Default constructor.
NodeId add(const DiscreteVariable &variable, NodeId id=0)
Add a chance variable, it's associate node and it's CPT.
<agrum/multidim/multiDimImplementation.h>
Template implementation of InfluenceDiagram/InfluenceDiagram.h classes.
NodeId addDecisionNode(const DiscreteVariable &variable, NodeId id=0)
Add a decision variable.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
virtual NodeId nodeId(const DiscreteVariable &var) const
Return id node from discrete var pointer.
void _removeTables()
Removing ancient table.
Class hash tables iterators.
Size NodeId
Type for node ids.
virtual const Potential< GUM_SCALAR > & cpt(NodeId varId) const
Returns the CPT of a potential variable.
Class representing an Influence Diagram.