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