aGrUM  0.13.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
 
PRMType< GUM_SCALAR > & type (const std::string &name)
 Returns a constant reference on a PRMType<GUM_SCALAR> given it's name. More...
 
const PRMType< GUM_SCALAR > & type (const std::string &name) const
 Returns a constant reference on a PRMType<GUM_SCALAR> given it's name. More...
 
const Set< PRMType< GUM_SCALAR > * > & types () const
 Returns the Set of all PRMType<GUM_SCALAR> 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

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
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< 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
Set< PRMType< GUM_SCALAR > * > __types
Set of all PRMType<GUM_SCALAR> in this PRM.
Definition: PRM.h:227
HashTable< std::string, PRMType< GUM_SCALAR > * > __typeMap
Mapping of all PRMType<GUM_SCALAR> given their name.
Definition: PRM.h:224
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
template<typename GUM_SCALAR>
gum::prm::PRM< GUM_SCALAR >::PRM ( const PRM< GUM_SCALAR > &  source)
private

Copy constructor.

Not Implemented.

Member Function Documentation

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.

References gum::LabelizedVariable::addLabel().

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

+ Here is the call graph for this function:

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 121 of file PRM_tpl.h.

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

121  {
122  return __classes;
123  }
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:

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 109 of file PRM_tpl.h.

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

109  {
110  return *(__classMap[name]);
111  }
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:

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 115 of file PRM_tpl.h.

115  {
116  return *(__classMap[name]);
117  }
HashTable< std::string, PRMClass< GUM_SCALAR > * > __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:212
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 127 of file PRM_tpl.h.

127  {
128  return *__interfaceMap[name];
129  }
HashTable< std::string, PRMInterface< GUM_SCALAR > * > __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:218
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 133 of file PRM_tpl.h.

133  {
134  return *__interfaceMap[name];
135  }
HashTable< std::string, PRMInterface< GUM_SCALAR > * > __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:218
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 145 of file PRM_tpl.h.

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

145  {
146  return *(__systemMap[name]);
147  }
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:

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 151 of file PRM_tpl.h.

151  {
152  return *(__systemMap[name]);
153  }
HashTable< std::string, PRMSystem< GUM_SCALAR > * > __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:230
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 139 of file PRM_tpl.h.

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

139  {
140  return __interfaces;
141  }
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:

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:

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
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:

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

Definition at line 71 of file PRM_tpl.h.

71  {
72  return __typeMap.exists(name);
73  }
HashTable< std::string, PRMType< GUM_SCALAR > * > __typeMap
Mapping of all PRMType<GUM_SCALAR> given their name.
Definition: PRM.h:224
template<typename GUM_SCALAR>
PRM< GUM_SCALAR >& gum::prm::PRM< GUM_SCALAR >::operator= ( const PRM< GUM_SCALAR > &  source)
private

Copy operator.

Not Implemented.

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 157 of file PRM_tpl.h.

157  {
158  return __systems;
159  }
Set< PRMSystem< GUM_SCALAR > * > __systems
Set of all Systems in this PRM.
Definition: PRM.h:233
template<typename GUM_SCALAR >
INLINE PRMType< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::type ( const std::string &  name)

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

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

Definition at line 92 of file PRM_tpl.h.

92  {
93  return *(__typeMap[name]);
94  }
HashTable< std::string, PRMType< GUM_SCALAR > * > __typeMap
Mapping of all PRMType<GUM_SCALAR> given their name.
Definition: PRM.h:224
template<typename GUM_SCALAR >
INLINE const PRMType< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::type ( const std::string &  name) const

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

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

Definition at line 98 of file PRM_tpl.h.

98  {
99  return *(__typeMap[name]);
100  }
HashTable< std::string, PRMType< GUM_SCALAR > * > __typeMap
Mapping of all PRMType<GUM_SCALAR> given their name.
Definition: PRM.h:224
template<typename GUM_SCALAR >
INLINE const Set< PRMType< GUM_SCALAR > * > & gum::prm::PRM< GUM_SCALAR >::types ( ) const

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

Definition at line 103 of file PRM_tpl.h.

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

Friends And Related Function Documentation

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

Definition at line 65 of file PRM.h.

Member Data Documentation

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.

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.

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.

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.

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.

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.

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

Mapping of all PRMType<GUM_SCALAR> given their name.

Definition at line 224 of file PRM.h.

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

Set of all PRMType<GUM_SCALAR> in this PRM.

Definition at line 227 of file PRM.h.


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