29 #ifndef GUM_GRAPHICALMODEL_H 30 #define GUM_GRAPHICALMODEL_H 31 #include <agrum/agrum.h> 32 #include <agrum/tools/multidim/instantiation.h> 34 #include <agrum/tools/graphs/DAG.h> 35 #include <agrum/tools/graphs/undiGraph.h> 37 #include <agrum/tools/graphicalModels/variableNodeMap.h> 87 void setProperty(
const std::string& name,
const std::string& value);
106 virtual bool empty()
const;
111 virtual bool exists(NodeId node)
const = 0;
112 bool exists(
const std::string& name)
const {
return exists(idFromName(name)); };
169 virtual bool isIndependent(NodeId X, NodeId Y,
const NodeSet& Z)
const = 0;
173 virtual bool isIndependent(
const NodeSet& X,
const NodeSet& Y,
const NodeSet& Z)
const = 0;
192 #ifndef GUM_NO_INLINE 193 # include <agrum/tools/graphicalModels/graphicalModel_inl.h> Virtual base class for probabilistic graphical models.
Instantiation completeInstantiation() const
Get an instantiation over all the variables of the model.
const std::string & propertyWithDefault(const std::string &name, const std::string &byDefault) const
Return the value of the property name of this GraphicalModel.
std::vector< NodeId > ids(const std::vector< std::string > &names) const
transform a vector of names into a vector of nodeId
virtual const VariableNodeMap & variableNodeMap() const =0
Returns a constant reference to the VariableNodeMap of this Graphical Model.
INLINE void emplace(Args &&... args)
virtual const NodeGraphPart & nodes() const =0
Returns a constant reference to the VariableNodeMap of this Graphical Model.
bool exists(const std::string &name) const
Return true if this graphical model is empty.
virtual bool isIndependent(NodeId X, NodeId Y, const NodeSet &Z) const =0
check if node X and node Y are independent given nodes Z
virtual Size size() const =0
Returns the number of variables in this Directed Graphical Model.
HashTable< std::string, std::string > & _properties_() const
Return the properties of this Directed Graphical Model and initialize the hash table is necessary...
void setProperty(const std::string &name, const std::string &value)
Add or change a property of this GraphicalModel.
NodeSet nodeset(const std::vector< std::string > &names) const
transform a vector of names into a NodeSet
virtual bool empty() const
Return true if this graphical model is empty.
virtual const DiscreteVariable & variableFromName(const std::string &name) const =0
Getter by name.
virtual ~GraphicalModel()
Destructor.
double log10DomainSize() const
HashTable< std::string, std::string > * _propertiesMap_
The properties of this Directed Graphical Model. Initialized using a lazy instantiation.
virtual NodeId nodeId(const DiscreteVariable &var) const =0
Return id node src discrete var pointer.
virtual bool isIndependent(const NodeSet &X, const NodeSet &Y, const NodeSet &Z) const =0
check if nodes X and nodes Y are independent given nodes Z
GraphicalModel & operator=(const GraphicalModel &source)
Private copy operator.
virtual bool exists(NodeId node) const =0
Return true if this node exists in this graphical model.
virtual NodeId idFromName(const std::string &name) const =0
Getter by name.
GraphicalModel()
Default constructor.
GraphicalModel(const GraphicalModel &source)
Copy constructor.
virtual const DiscreteVariable & variable(NodeId id) const =0
Returns a constant reference over a variable given it's node id.
const std::string & property(const std::string &name) const
Return the value of the property name of this GraphicalModel.
std::vector< std::string > names(const NodeSet &ids) const
transform a NodeSet in a vector of names