30 #ifndef GUM_BAYES_NET_FRAGMENT_H 31 #define GUM_BAYES_NET_FRAGMENT_H 72 template <
typename GUM_SCALAR >
172 virtual std::string
toDot()
const override;
282 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 290 #endif // GUM_BAYES_NET_FRAGMENT_H aGrUM's Potential is a multi-dimensional array with tensor operators.
virtual NodeId nodeId(const DiscreteVariable &var) const override
Return id node from discrete var pointer.
Abstract Base class for all diGraph Listener.
virtual void whenNodeDeleted(const void *src, NodeId id) noexcept override
the action to take when a node has just been removed from the graph
void uninstallCPT(NodeId id) noexcept
uninstall a local CPT.
NodeProperty< const Potential< GUM_SCALAR > *> __localCPTs
Mapping between the variable's id and their CPT specific to this Fragment.
virtual const DiscreteVariable & variableFromName(const std::string &name) const override
Getter by name.
void _installCPT(NodeId id, const Potential< GUM_SCALAR > *pot) noexcept
BayesNetFragment()=delete
void installCPT(NodeId id, const Potential< GUM_SCALAR > *pot)
install a local cpt for a node into the fragment.
virtual void whenArcAdded(const void *src, NodeId from, NodeId to) noexcept override
the action to take when a new arc is inserted into the graph
virtual const VariableNodeMap & variableNodeMap() const override
Returns a constant reference to the VariableNodeMap of this BN.
Container used to map discrete variables with nodes.
void _installArc(NodeId from, NodeId to) noexcept
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Base class for discrete random variable.
void installAscendants(NodeId id)
install a node and all its ascendants
Class representing the minimal interface for Bayesian Network.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual ~BayesNetFragment()
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for generic Hash Tables.
virtual const Potential< GUM_SCALAR > & cpt(NodeId varId) const override
Returns the CPT of a variable.
const IBayesNet< GUM_SCALAR > & __bn
The referred BayesNet.
virtual const DiscreteVariable & variable(NodeId id) const override
Returns a constant reference over a variabe given it's node id.
const NodeGraphPart & nodes() const
Returns a constant reference to the dag of this Bayes Net.
virtual void whenArcDeleted(const void *src, NodeId from, NodeId to) noexcept override
the action to take when an arc has just been removed from the graph
Portion of a BN identified by the list of nodes and a BayesNet.
void installNode(NodeId id)
install a node referenced by its nodeId
virtual std::string toDot() const override
creates a dot representing the whole referred BN hilighting the fragment.
void uninstallNode(NodeId id) noexcept
uninstall a node referenced by its nodeId
bool isInstalledNode(NodeId id) const noexcept
check if a certain NodeId exists in the fragment
void installMarginal(NodeId id, const Potential< GUM_SCALAR > *pot)
install a local marginal for a node into the fragment.
bool checkConsistency() const noexcept
returns true if all nodes in the fragment are consistent
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual NodeId idFromName(const std::string &name) const override
Getter by name.
virtual void whenNodeAdded(const void *src, NodeId id) noexcept override
the action to take when a new node is inserted into the graph
void _uninstallArc(NodeId from, NodeId to) noexcept
void _uninstallCPT(NodeId id) noexcept
uninstall a local CPT.
const DAG & dag() const
Returns a constant reference to the dag of this Bayes Net.
Size NodeId
Type for node ids.