aGrUM  0.17.2
a C++ library for (probabilistic) graphical models
graphicalModel.h
Go to the documentation of this file.
1 
30 #ifndef GUM_GRAPHICALMODEL_H
31 #define GUM_GRAPHICALMODEL_H
32 #include <agrum/agrum.h>
34 
35 #include <agrum/tools/graphs/DAG.h>
37 
39 
40 namespace gum {
41 
49  public:
52 
57 
61  virtual ~GraphicalModel();
62 
66  GraphicalModel(const GraphicalModel& source);
67 
71 
76  const std::string& property(const std::string& name) const;
77 
82  const std::string& propertyWithDefault(const std::string& name,
83  const std::string& byDefault) const;
84 
88  void setProperty(const std::string& name, const std::string& value);
89 
93 
97  virtual const VariableNodeMap& variableNodeMap() const = 0;
98 
102  virtual Size size() const = 0;
103 
107  virtual bool empty() const;
108 
109  virtual const NodeGraphPart& nodes() const = 0;
110 
113 
118  virtual const DiscreteVariable& variable(NodeId id) const = 0;
119 
124  virtual NodeId nodeId(const DiscreteVariable& var) const = 0;
125 
128  virtual NodeId idFromName(const std::string& name) const = 0;
129 
132  virtual const DiscreteVariable&
133  variableFromName(const std::string& name) const = 0;
134 
136 
137  double log10DomainSize() const;
138 
139  protected:
143  GraphicalModel& operator=(const GraphicalModel& source);
144 
145  private:
149 
153  };
154 } // namespace gum
155 
156 #ifndef GUM_NO_INLINE
158 #endif /* GUM_NO_INLINE */
159 
160 #endif /* GUM_GRAPHICALMODEL_H */
Virtual base class for probabilistic graphical models.
Instantiation completeInstantiation() const
Get an instantiation over all the variables of the model.
HashTable< std::string, std::string > * __propertiesMap
The properties of this Directed Graphical Model. Initialized using a lazy instantiation.
const std::string & propertyWithDefault(const std::string &name, const std::string &byDefault) const
Return the value of the property name of this GraphicalModel.
virtual const VariableNodeMap & variableNodeMap() const =0
Returns a constant reference to the VariableNodeMap of this Graphical Model.
virtual const NodeGraphPart & nodes() const =0
Returns a constant reference to the VariableNodeMap of this Graphical Model.
Container used to map discrete variables with nodes.
virtual Size size() const =0
Returns the number of variables in this Directed Graphical Model.
void setProperty(const std::string &name, const std::string &value)
Add or change a property of this GraphicalModel.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Base class for discrete random variable.
virtual bool empty() const
Retursn true if this Directed Graphical Model is empty.
virtual const DiscreteVariable & variableFromName(const std::string &name) const =0
Getter by name.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Definition: agrum.h:25
virtual ~GraphicalModel()
Destructor.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
double log10DomainSize() const
virtual NodeId nodeId(const DiscreteVariable &var) const =0
Return id node src discrete var pointer.
GraphicalModel & operator=(const GraphicalModel &source)
Private copy operator.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Class for node sets in graph.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:83
virtual NodeId idFromName(const std::string &name) const =0
Getter by name.
GraphicalModel()
Default constructor.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
virtual const DiscreteVariable & variable(NodeId id) const =0
Returns a constant reference over a variable given it&#39;s node id.
const std::string & property(const std::string &name) const
Return the value of the property name of this GraphicalModel.
HashTable< std::string, std::string > & __properties() const
Return the properties of this Directed Graphical Model and initialize the hash table is necessary...
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.