aGrUM  0.14.2
gum::prm::PRM< GUM_SCALAR > Class Template Reference

This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>. More...

#include <agrum/PRM/PRM.h>

+ Collaboration diagram for gum::prm::PRM< GUM_SCALAR >:

Public Member Functions

Destructor.
 PRM ()
 Default constructor. More...
 
 ~PRM ()
 Destructor. More...
 
Getters and setters.
bool isType (const std::string &name) const
 
bool isClass (const std::string &name) const
 
bool isInterface (const std::string &name) const
 
bool isSystem (const std::string &name) const
 
PRMTypetype (const std::string &name)
 Returns a constant reference on a PRMType given it's name. More...
 
const PRMTypetype (const std::string &name) const
 Returns a constant reference on a PRMType given it's name. More...
 
const Set< PRMType *> & types () const
 Returns the Set of all PRMType in this PRM. More...
 
PRMClass< GUM_SCALAR > & getClass (const std::string &name)
 Returns a constant reference on a Class<GUM_SCALAR> given it's name. More...
 
const PRMClass< GUM_SCALAR > & getClass (const std::string &name) const
 Returns a constant reference on a Class<GUM_SCALAR> given it's name. More...
 
const Set< PRMClass< GUM_SCALAR > *> & classes () const
 Returns the Set of all Class<GUM_SCALAR> in this PRM. More...
 
PRMInterface< GUM_SCALAR > & getInterface (const std::string &name)
 Returns a constant reference on a Class<GUM_SCALAR> given it's name. More...
 
const PRMInterface< GUM_SCALAR > & getInterface (const std::string &name) const
 Returns a constant reference on a Class<GUM_SCALAR> given it's name. More...
 
const Set< PRMInterface< GUM_SCALAR > *> & interfaces () const
 Returns the Set of all Class<GUM_SCALAR> in this PRM. More...
 
PRMSystem< GUM_SCALAR > & getSystem (const std::string &name)
 Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name. More...
 
const PRMSystem< GUM_SCALAR > & getSystem (const std::string &name) const
 Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name. More...
 
const Set< PRMSystem< GUM_SCALAR > *> & systems () const
 Returns the Set of all Systems in this PRM. More...
 

Friends

class PRMFactory< GUM_SCALAR >
 

Detailed Description

template<typename GUM_SCALAR>
class gum::prm::PRM< GUM_SCALAR >

This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.

Definition at line 63 of file PRM.h.

Constructor & Destructor Documentation

◆ PRM() [1/2]

template<typename GUM_SCALAR >
gum::prm::PRM< GUM_SCALAR >::PRM ( )

Default constructor.

Definition at line 33 of file PRM_tpl.h.

33  {
34  GUM_CONSTRUCTOR(PRM);
36  }
PRM()
Default constructor.
Definition: PRM_tpl.h:33
void __addBuiltInTypes()
Add the built-in types in the PRM.
Definition: PRM_tpl.h:61

◆ ~PRM()

template<typename GUM_SCALAR >
gum::prm::PRM< GUM_SCALAR >::~PRM ( )

Destructor.

Definition at line 40 of file PRM_tpl.h.

40  {
41  GUM_DESTRUCTOR(PRM);
42  __classMap.clear();
43  __typeMap.clear();
44  __systemMap.clear();
45 
46  for (const auto sys : __systems)
47  delete sys;
48 
49  for (const auto cla : __classes)
50  delete cla;
51 
52  for (const auto inter : __interfaces)
53  delete inter;
54 
55  for (const auto typ : __types)
56  delete typ;
57  }
PRM()
Default constructor.
Definition: PRM_tpl.h:33
Set< PRMType *> __types
Set of all PRMType in this PRM.
Definition: PRM.h:227
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:224
Set< PRMInterface< GUM_SCALAR > *> __interfaces
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:221
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:230
Set< PRMClass< GUM_SCALAR > *> __classes
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:215
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:212
Set< PRMSystem< GUM_SCALAR > *> __systems
Set of all Systems in this PRM.
Definition: PRM.h:233

◆ PRM() [2/2]

template<typename GUM_SCALAR>
gum::prm::PRM< GUM_SCALAR >::PRM ( const PRM< GUM_SCALAR > &  source)
private

Copy constructor.

Not Implemented.

Member Function Documentation

◆ __addBuiltInTypes()

template<typename GUM_SCALAR >
void gum::prm::PRM< GUM_SCALAR >::__addBuiltInTypes ( )
private

Add the built-in types in the PRM.

Definition at line 61 of file PRM_tpl.h.

61  {
62  LabelizedVariable var("boolean", "built-in type", 0);
63  var.addLabel("false");
64  var.addLabel("true");
65  PRMType* boolean = new PRMType(var);
66  __types.insert(boolean);
67  __typeMap.insert("boolean", boolean);
68  }
Set< PRMType *> __types
Set of all PRMType in this PRM.
Definition: PRM.h:227
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:224

◆ classes()

template<typename GUM_SCALAR >
INLINE const Set< PRMClass< GUM_SCALAR > *> & gum::prm::PRM< GUM_SCALAR >::classes ( ) const

Returns the Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 119 of file PRM_tpl.h.

Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::__buildGraph().

119  {
120  return __classes;
121  }
Set< PRMClass< GUM_SCALAR > *> __classes
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:215
+ Here is the caller graph for this function:

◆ getClass() [1/2]

template<typename GUM_SCALAR >
INLINE PRMClass< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getClass ( const std::string &  name)

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 107 of file PRM_tpl.h.

Referenced by gum::O3prmBNReader< GUM_SCALAR >::proceed().

107  {
108  return *(__classMap[name]);
109  }
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:212
+ Here is the caller graph for this function:

◆ getClass() [2/2]

template<typename GUM_SCALAR >
INLINE const PRMClass< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getClass ( const std::string &  name) const

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 113 of file PRM_tpl.h.

113  {
114  return *(__classMap[name]);
115  }
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:212

◆ getInterface() [1/2]

template<typename GUM_SCALAR >
INLINE PRMInterface< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getInterface ( const std::string &  name)

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 125 of file PRM_tpl.h.

125  {
126  return *__interfaceMap[name];
127  }
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:218

◆ getInterface() [2/2]

template<typename GUM_SCALAR >
INLINE const PRMInterface< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getInterface ( const std::string &  name) const

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 131 of file PRM_tpl.h.

131  {
132  return *__interfaceMap[name];
133  }
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:218

◆ getSystem() [1/2]

template<typename GUM_SCALAR >
INLINE PRMSystem< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getSystem ( const std::string &  name)

Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no model is found with the given name.

Definition at line 143 of file PRM_tpl.h.

Referenced by gum::O3prmBNReader< GUM_SCALAR >::proceed(), and gum::prm::o3prmr::O3prmrInterpreter::system().

143  {
144  return *(__systemMap[name]);
145  }
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:230
+ Here is the caller graph for this function:

◆ getSystem() [2/2]

template<typename GUM_SCALAR >
INLINE const PRMSystem< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getSystem ( const std::string &  name) const

Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no model is found with the given name.

Definition at line 149 of file PRM_tpl.h.

149  {
150  return *(__systemMap[name]);
151  }
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:230

◆ interfaces()

template<typename GUM_SCALAR >
INLINE const Set< PRMInterface< GUM_SCALAR > *> & gum::prm::PRM< GUM_SCALAR >::interfaces ( ) const

Returns the Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 137 of file PRM_tpl.h.

Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::__buildGraph().

137  {
138  return __interfaces;
139  }
Set< PRMInterface< GUM_SCALAR > *> __interfaces
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:221
+ Here is the caller graph for this function:

◆ isClass()

template<typename GUM_SCALAR >
INLINE bool gum::prm::PRM< GUM_SCALAR >::isClass ( const std::string &  name) const
Parameters
nameThe name of a possible Class<GUM_SCALAR> in this PRM.
Returns
Returns true if name names a Class<GUM_SCALAR> in this PRM.

Definition at line 76 of file PRM_tpl.h.

Referenced by gum::O3prmBNReader< GUM_SCALAR >::proceed().

76  {
77  return __classMap.exists(name);
78  }
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:212
+ Here is the caller graph for this function:

◆ isInterface()

template<typename GUM_SCALAR >
INLINE bool gum::prm::PRM< GUM_SCALAR >::isInterface ( const std::string &  name) const
Parameters
nameThe name of a possible PRMInterface<GUM_SCALAR> in this PRM.
Returns
Returns true if name names a PRMInterface<GUM_SCALAR> in this PRM.

Definition at line 81 of file PRM_tpl.h.

81  {
82  return __interfaceMap.exists(name);
83  }
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:218

◆ isSystem()

template<typename GUM_SCALAR >
INLINE bool gum::prm::PRM< GUM_SCALAR >::isSystem ( const std::string &  name) const
Parameters
nameThe name of a possible PRMSystem<GUM_SCALAR> in this PRM.
Returns
Returns true if name names a PRMSystem<GUM_SCALAR> in this PRM.

Definition at line 86 of file PRM_tpl.h.

Referenced by gum::O3prmBNReader< GUM_SCALAR >::proceed(), and gum::prm::o3prmr::O3prmrInterpreter::system().

86  {
87  return __systemMap.exists(name);
88  }
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:230
+ Here is the caller graph for this function:

◆ isType()

template<typename GUM_SCALAR >
INLINE bool gum::prm::PRM< GUM_SCALAR >::isType ( const std::string &  name) const
Parameters
nameThe name of a possible PRMType in this PRM.
Returns
Returns true if name names a PRMType in this PRM.

Definition at line 71 of file PRM_tpl.h.

71  {
72  return __typeMap.exists(name);
73  }
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:224

◆ operator=()

template<typename GUM_SCALAR>
PRM< GUM_SCALAR >& gum::prm::PRM< GUM_SCALAR >::operator= ( const PRM< GUM_SCALAR > &  source)
private

Copy operator.

Not Implemented.

◆ systems()

template<typename GUM_SCALAR >
INLINE const Set< PRMSystem< GUM_SCALAR > *> & gum::prm::PRM< GUM_SCALAR >::systems ( ) const

Returns the Set of all Systems in this PRM.

Definition at line 155 of file PRM_tpl.h.

155  {
156  return __systems;
157  }
Set< PRMSystem< GUM_SCALAR > *> __systems
Set of all Systems in this PRM.
Definition: PRM.h:233

◆ type() [1/2]

template<typename GUM_SCALAR >
INLINE PRMType & gum::prm::PRM< GUM_SCALAR >::type ( const std::string &  name)

Returns a constant reference on a PRMType given it's name.

Exceptions
NotFoundRaised if no type is found with the given name.

Definition at line 91 of file PRM_tpl.h.

91  {
92  return *(__typeMap[name]);
93  }
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:224

◆ type() [2/2]

template<typename GUM_SCALAR >
INLINE const PRMType & gum::prm::PRM< GUM_SCALAR >::type ( const std::string &  name) const

Returns a constant reference on a PRMType given it's name.

Exceptions
NotFoundRaised if no type is found with the given name.

Definition at line 96 of file PRM_tpl.h.

96  {
97  return *(__typeMap[name]);
98  }
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:224

◆ types()

template<typename GUM_SCALAR >
INLINE const Set< PRMType *> & gum::prm::PRM< GUM_SCALAR >::types ( ) const

Returns the Set of all PRMType in this PRM.

Definition at line 101 of file PRM_tpl.h.

101  {
102  return __types;
103  }
Set< PRMType *> __types
Set of all PRMType in this PRM.
Definition: PRM.h:227

Friends And Related Function Documentation

◆ PRMFactory< GUM_SCALAR >

template<typename GUM_SCALAR>
friend class PRMFactory< GUM_SCALAR >
friend

Definition at line 65 of file PRM.h.

Member Data Documentation

◆ __classes

template<typename GUM_SCALAR>
Set< PRMClass< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::__classes
private

Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 215 of file PRM.h.

◆ __classMap

template<typename GUM_SCALAR>
HashTable< std::string, PRMClass< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::__classMap
private

Mapping of all Class<GUM_SCALAR> given their name.

Definition at line 212 of file PRM.h.

◆ __interfaceMap

template<typename GUM_SCALAR>
HashTable< std::string, PRMInterface< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::__interfaceMap
private

Mapping of all Class<GUM_SCALAR> given their name.

Definition at line 218 of file PRM.h.

◆ __interfaces

template<typename GUM_SCALAR>
Set< PRMInterface< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::__interfaces
private

Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 221 of file PRM.h.

◆ __systemMap

template<typename GUM_SCALAR>
HashTable< std::string, PRMSystem< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::__systemMap
private

Mapping of all Systems given their name.

Definition at line 230 of file PRM.h.

◆ __systems

template<typename GUM_SCALAR>
Set< PRMSystem< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::__systems
private

Set of all Systems in this PRM.

Definition at line 233 of file PRM.h.

◆ __typeMap

template<typename GUM_SCALAR>
HashTable< std::string, PRMType* > gum::prm::PRM< GUM_SCALAR >::__typeMap
private

Mapping of all PRMType given their name.

Definition at line 224 of file PRM.h.

◆ __types

template<typename GUM_SCALAR>
Set< PRMType* > gum::prm::PRM< GUM_SCALAR >::__types
private

Set of all PRMType in this PRM.

Definition at line 227 of file PRM.h.


The documentation for this class was generated from the following files: