aGrUM  0.15.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 66 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 36 of file PRM_tpl.h.

36  {
37  GUM_CONSTRUCTOR(PRM);
39  }
PRM()
Default constructor.
Definition: PRM_tpl.h:36
void __addBuiltInTypes()
Add the built-in types in the PRM.
Definition: PRM_tpl.h:64

◆ ~PRM()

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

Destructor.

Definition at line 43 of file PRM_tpl.h.

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

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

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

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

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

122  {
123  return __classes;
124  }
Set< PRMClass< GUM_SCALAR > *> __classes
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:218
+ 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 110 of file PRM_tpl.h.

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

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

116  {
117  return *(__classMap[name]);
118  }
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:215

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

128  {
129  return *__interfaceMap[name];
130  }
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:221

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

134  {
135  return *__interfaceMap[name];
136  }
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:221

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

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

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

152  {
153  return *(__systemMap[name]);
154  }
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:233

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

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

140  {
141  return __interfaces;
142  }
Set< PRMInterface< GUM_SCALAR > *> __interfaces
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:224
+ 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 79 of file PRM_tpl.h.

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

79  {
80  return __classMap.exists(name);
81  }
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:215
+ 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 84 of file PRM_tpl.h.

84  {
85  return __interfaceMap.exists(name);
86  }
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:221

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

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

89  {
90  return __systemMap.exists(name);
91  }
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:233
+ 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 74 of file PRM_tpl.h.

74  {
75  return __typeMap.exists(name);
76  }
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:227

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

158  {
159  return __systems;
160  }
Set< PRMSystem< GUM_SCALAR > *> __systems
Set of all Systems in this PRM.
Definition: PRM.h:236

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

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

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

99  {
100  return *(__typeMap[name]);
101  }
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:227

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

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

Friends And Related Function Documentation

◆ PRMFactory< GUM_SCALAR >

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

Definition at line 68 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 218 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 215 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 221 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 224 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 233 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 236 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 227 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 230 of file PRM.h.


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