49#ifndef GUM_GRAPHICALMODEL_H
50#define GUM_GRAPHICALMODEL_H
97 const std::string&
property(std::string_view name)
const;
104 const std::string& byDefault)
const;
109 void setProperty(std::string_view name, std::string_view value);
114 std::vector< std::string >
properties()
const;
144 virtual bool empty()
const;
150 virtual bool exists(std::string_view name)
const = 0;
156 std::vector< std::string >
names(
const std::vector< NodeId >&
ids)
const;
168 std::vector< NodeId >
ids(
const std::vector< std::string >&
names)
const;
Base classes for directed acyclic graphs.
Base class for discrete random variable.
const HashTable< std::string, std::string > & _properties_() const
Return the properties of this Directed Graphical Model.
virtual ~GraphicalModel()
Destructor.
virtual const DiscreteVariable & variable(NodeId id) const =0
Returns a constant reference over a variable given it's node id.
const std::string & property(std::string_view name) const
Return the value of the property name of this GraphicalModel.
void _nameNodes_(NodeGraphPart &g) const
Names every node of g using variable(id).name() for each node id in g.
GraphicalModel & operator=(const GraphicalModel &source)
Private copy operator.
void setProperty(std::string_view name, std::string_view value)
Add or change a property of this GraphicalModel.
virtual const VariableNodeMap & variableNodeMap() const =0
Returns a constant reference to the VariableNodeMap of this Graphical Model.
virtual NodeSet family(const NodeId id) const =0
returns the family of a noe (parents or neighbours) of a node and the node
HashTable< std::string, std::string > _propertiesMap_
The properties of this Directed Graphical Model.
std::vector< NodeId > ids(const std::vector< std::string > &names) const
transform a vector of names into a vector of nodeId
void updateMetaData()
update the meta data of this Graphical Model (version, creation date, last modification date) This me...
virtual const NodeGraphPart & nodes() const =0
Returns the number of variables in this Directed Graphical Model.
virtual const DiscreteVariable & variableFromName(std::string_view name) const =0
Getter by name.
std::vector< std::string > names(const std::vector< NodeId > &ids) const
transform a vector of NodeId in a vector of names
virtual bool exists(std::string_view name) const =0
Returns the number of variables in this Directed Graphical Model.
GraphicalModel()
Default constructor.
virtual bool exists(NodeId node) const =0
Return true if this node exists in this graphical model.
gum::VariableSet variables(const std::vector< std::string > &l) const
transform a vector of names into a VariableeSet
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
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 NodeId idFromName(std::string_view name) const =0
Getter by name.
double log10DomainSize() const
std::vector< std::string > properties() const
List of all the names of property in the Graphical model.
NodeSet nodeset(const std::vector< std::string > &names) const
transform a vector of names into a NodeSet
virtual NodeId nodeId(const DiscreteVariable &var) const =0
Return id node src discrete var pointer.
Instantiation completeInstantiation() const
Get an instantiation over all the variables of the model.
virtual bool empty() const
Return true if this graphical model is empty.
virtual NodeSet family(std::string_view name) const =0
bool existsProperty(std::string_view name) const
check wether a property exists in this GraphicalModel
static std::string spaceCplxToString(double dSize, int dim, Size usedMem)
send to the stream the space complexity with 3 parametrs
const std::string & propertyWithDefault(std::string_view name, const std::string &byDefault) const
Return the value of the property name of this GraphicalModel.
virtual Size size() const =0
Returns the number of variables in this Directed Graphical Model.
Class for assigning/browsing values to tuples of discrete variables.
Class for node sets in graph.
Container used to map discrete variables with nodes.
Interface-like class encapsulating basic functionalities for both a IBayesNet and IMarkovRandomField.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
Header files of gum::Instantiation.
gum is the global namespace for all aGrUM entities
Set< const DiscreteVariable * > VariableSet
Header of class VariableNodeMap.