aGrUM  0.16.0
PRM.h
Go to the documentation of this file.
1 
30 #ifndef GUM_PRM_H
31 #define GUM_PRM_H
32 
33 #include <string>
34 
35 #include <agrum/core/hashTable.h>
36 #include <agrum/core/sequence.h>
37 
47 
49 
50 namespace gum {
51  namespace prm {
52 
53  template < typename GUM_SCALAR >
54  class PRMSystem;
55  template < typename GUM_SCALAR >
56  class PRMFactory;
65  template < typename GUM_SCALAR >
66  class PRM {
67  public:
68  friend class PRMFactory< GUM_SCALAR >;
69 
70  // ========================================================================
72  // ========================================================================
74 
78  PRM();
79 
83  ~PRM();
84 
86  // ========================================================================
88  // ========================================================================
90 
95  bool isType(const std::string& name) const;
96 
101  bool isClass(const std::string& name) const;
102 
109  bool isInterface(const std::string& name) const;
110 
115  bool isSystem(const std::string& name) const;
116 
121  PRMType& type(const std::string& name);
122 
127  const PRMType& type(const std::string& name) const;
128 
132  const Set< PRMType* >& types() const;
133 
138  PRMClass< GUM_SCALAR >& getClass(const std::string& name);
139 
144  const PRMClass< GUM_SCALAR >& getClass(const std::string& name) const;
145 
149  const Set< PRMClass< GUM_SCALAR >* >& classes() const;
150 
155  PRMInterface< GUM_SCALAR >& getInterface(const std::string& name);
156 
162  getInterface(const std::string& name) const;
163 
168 
174  PRMSystem< GUM_SCALAR >& getSystem(const std::string& name);
175 
181  const PRMSystem< GUM_SCALAR >& getSystem(const std::string& name) const;
182 
186  const Set< PRMSystem< GUM_SCALAR >* >& systems() const;
187 
189  private:
190  // ========================================================================
192  // ========================================================================
194 
198  PRM(const PRM< GUM_SCALAR >& source);
199 
204 
206  void __addBuiltInTypes();
207 
209  // ========================================================================
211  // ========================================================================
213 
216 
219 
222 
225 
228 
231 
234 
237 
239  };
240 
241 
242 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
243  extern template class PRM< double >;
244 #endif
245 
246 
247  } /* namespace prm */
248 } /* namespace gum */
249 
250 #include <agrum/PRM/PRM_tpl.h>
251 
252 #endif /* GUM_PRM_H */
PRMInterface< GUM_SCALAR > & getInterface(const std::string &name)
Returns a constant reference on a Class<GUM_SCALAR> given it&#39;s name.
Definition: PRM_tpl.h:128
const Set< PRMType *> & types() const
Returns the Set of all PRMType in this PRM.
Definition: PRM_tpl.h:104
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool isClass(const std::string &name) const
Definition: PRM_tpl.h:79
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.
PRM()
Default constructor.
Definition: PRM_tpl.h:36
const Set< PRMSystem< GUM_SCALAR > *> & systems() const
Returns the Set of all Systems in this PRM.
Definition: PRM_tpl.h:158
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __addBuiltInTypes()
Add the built-in types in the PRM.
Definition: PRM_tpl.h:64
const Set< PRMClass< GUM_SCALAR > *> & classes() const
Returns the Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM_tpl.h:122
const Set< PRMInterface< GUM_SCALAR > *> & interfaces() const
Returns the Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM_tpl.h:140
Set< PRMType *> __types
Set of all PRMType in this PRM.
Definition: PRM.h:230
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for generic Hash Tables.
Definition: hashTable.h:679
bool isType(const std::string &name) const
Definition: PRM_tpl.h:74
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:227
~PRM()
Destructor.
Definition: PRM_tpl.h:43
Factory which builds a PRM<GUM_SCALAR>.
Definition: PRMType.h:50
PRMType & type(const std::string &name)
Returns a constant reference on a PRMType given it&#39;s name.
Definition: PRM_tpl.h:94
bool isSystem(const std::string &name) const
Definition: PRM_tpl.h:89
PRMSystem< GUM_SCALAR > & getSystem(const std::string &name)
Returns a constant reference on a PRMSystem<GUM_SCALAR> given it&#39;s name.
Definition: PRM_tpl.h:146
A PRMSystem is a container of PRMInstance and describe a relational skeleton.
Definition: PRMObject.h:229
Set< PRMInterface< GUM_SCALAR > *> __interfaces
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:224
This is a decoration of the DiscreteVariable class.
Definition: PRMType.h:63
An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALA...
Definition: PRMClass.h:54
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:233
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.
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:221
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
Definition: PRM.h:66
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
Definition: PRMClass.h:66
Set< PRMClass< GUM_SCALAR > *> __classes
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:218
PRMClass< GUM_SCALAR > & getClass(const std::string &name)
Returns a constant reference on a Class<GUM_SCALAR> given it&#39;s name.
Definition: PRM_tpl.h:110
PRM< GUM_SCALAR > & operator=(const PRM< GUM_SCALAR > &source)
Copy operator.
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:215
bool isInterface(const std::string &name) const
Definition: PRM_tpl.h:84
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Set< PRMSystem< GUM_SCALAR > *> __systems
Set of all Systems in this PRM.
Definition: PRM.h:236