aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
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.
 ~PRM ()
 Destructor.
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.
const PRMTypetype (const std::string &name) const
 Returns a constant reference on a PRMType given it's name.
const Set< PRMType * > & types () const
 Returns the Set of all PRMType in this PRM.
PRMClass< GUM_SCALAR > & getClass (const std::string &name)
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const PRMClass< GUM_SCALAR > & getClass (const std::string &name) const
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const Set< PRMClass< GUM_SCALAR > * > & classes () const
 Returns the Set of all Class<GUM_SCALAR> in this PRM.
PRMInterface< GUM_SCALAR > & getInterface (const std::string &name)
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const PRMInterface< GUM_SCALAR > & getInterface (const std::string &name) const
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const Set< PRMInterface< GUM_SCALAR > * > & interfaces () const
 Returns the Set of all Class<GUM_SCALAR> in this PRM.
PRMSystem< GUM_SCALAR > & getSystem (const std::string &name)
 Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.
const PRMSystem< GUM_SCALAR > & getSystem (const std::string &name) const
 Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.
const Set< PRMSystem< GUM_SCALAR > * > & systems () const
 Returns the Set of all Systems in this PRM.

Private Member Functions

Private methods.
 PRM (const PRM< GUM_SCALAR > &source)
 Copy constructor.
PRM< GUM_SCALAR > & operator= (const PRM< GUM_SCALAR > &source)
 Copy operator.
void _addBuiltInTypes_ ()
 Add the built-in types in the PRM.

Private Attributes

Private members.
HashTable< std::string, PRMClass< GUM_SCALAR > * > _classMap_
 Mapping of all Class<GUM_SCALAR> given their name.
Set< PRMClass< GUM_SCALAR > * > _classes_
 Set of all Class<GUM_SCALAR> in this PRM.
HashTable< std::string, PRMInterface< GUM_SCALAR > * > _interfaceMap_
 Mapping of all Class<GUM_SCALAR> given their name.
Set< PRMInterface< GUM_SCALAR > * > _interfaces_
 Set of all Class<GUM_SCALAR> in this PRM.
HashTable< std::string, PRMType * > _typeMap_
 Mapping of all PRMType given their name.
Set< PRMType * > _types_
 Set of all PRMType in this PRM.
HashTable< std::string, PRMSystem< GUM_SCALAR > * > _systemMap_
 Mapping of all Systems given their name.
Set< PRMSystem< GUM_SCALAR > * > _systems_
 Set of all Systems in this PRM.

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

56 {
59 }
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
Definition PRM.h:74
PRM()
Default constructor.
Definition PRM_tpl.h:56
void _addBuiltInTypes_()
Add the built-in types in the PRM.
Definition PRM_tpl.h:84

References PRM(), and _addBuiltInTypes_().

Referenced by PRM(), PRM(), ~PRM(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~PRM()

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

Destructor.

Definition at line 63 of file PRM_tpl.h.

63 {
65 _classMap_.clear();
66 _typeMap_.clear();
67 _systemMap_.clear();
68
69 for (const auto sys: _systems_)
70 delete sys;
71
72 for (const auto cla: _classes_)
73 delete cla;
74
75 for (const auto inter: _interfaces_)
76 delete inter;
77
78 for (const auto typ: _types_)
79 delete typ;
80 }
HashTable< std::string, PRMType * > _typeMap_
Mapping of all PRMType given their name.
Definition PRM.h:235
Set< PRMType * > _types_
Set of all PRMType in this PRM.
Definition PRM.h:238
HashTable< std::string, PRMClass< GUM_SCALAR > * > _classMap_
Mapping of all Class<GUM_SCALAR> given their name.
Definition PRM.h:223
Set< PRMSystem< GUM_SCALAR > * > _systems_
Set of all Systems in this PRM.
Definition PRM.h:244
Set< PRMInterface< GUM_SCALAR > * > _interfaces_
Set of all Class<GUM_SCALAR> in this PRM.
Definition PRM.h:232
HashTable< std::string, PRMSystem< GUM_SCALAR > * > _systemMap_
Mapping of all Systems given their name.
Definition PRM.h:241
Set< PRMClass< GUM_SCALAR > * > _classes_
Set of all Class<GUM_SCALAR> in this PRM.
Definition PRM.h:226

References PRM(), _classes_, _classMap_, _interfaces_, _systemMap_, _systems_, _typeMap_, and _types_.

Here is the call graph for this function:

◆ PRM() [2/2]

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

Copy constructor.

Not Implemented.

References PRM().

Here is the call graph for this function:

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

84 {
85 LabelizedVariable var("boolean", "built-in type", 0);
86 var.addLabel("false");
87 var.addLabel("true");
88 PRMType* boolean = new PRMType(var);
89 _types_.insert(boolean);
90 _typeMap_.insert("boolean", boolean);
91 }

Referenced by PRM().

Here is the caller graph for this function:

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

140 {
141 return _classes_;
142 }

References _classes_.

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

129 {
130 return *(_classMap_[name]);
131 }

References _classMap_.

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

135 {
136 return *(_classMap_[name]);
137 }

References _classMap_.

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

145 {
146 return *_interfaceMap_[name];
147 }
HashTable< std::string, PRMInterface< GUM_SCALAR > * > _interfaceMap_
Mapping of all Class<GUM_SCALAR> given their name.
Definition PRM.h:229

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

151 {
152 return *_interfaceMap_[name];
153 }

References _interfaceMap_.

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

161 {
162 return *(_systemMap_[name]);
163 }

References _systemMap_.

Referenced by gum::prm::o3prmr::O3prmrInterpreter::system().

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

167 {
168 return *(_systemMap_[name]);
169 }

References _systemMap_.

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

156 {
157 return _interfaces_;
158 }

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

99 {
100 return _classMap_.exists(name);
101 }

References _classMap_.

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

104 {
105 return _interfaceMap_.exists(name);
106 }

References _interfaceMap_.

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

109 {
110 return _systemMap_.exists(name);
111 }

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

94 {
95 return _typeMap_.exists(name);
96 }

References _typeMap_.

◆ operator=()

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

Copy operator.

Not Implemented.

References PRM().

Here is the call graph for this function:

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

172 {
173 return _systems_;
174 }

References _systems_.

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

114 {
115 return *(_typeMap_[name]);
116 }

References _typeMap_.

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

119 {
120 return *(_typeMap_[name]);
121 }

References _typeMap_.

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

124 {
125 return _types_;
126 }

References _types_.

◆ PRMFactory< GUM_SCALAR >

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

Definition at line 251 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 226 of file PRM.h.

Referenced by ~PRM(), and classes().

◆ _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 223 of file PRM.h.

Referenced by ~PRM(), getClass(), getClass(), and isClass().

◆ _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 229 of file PRM.h.

Referenced by getInterface(), and isInterface().

◆ _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 232 of file PRM.h.

Referenced by ~PRM().

◆ _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 241 of file PRM.h.

Referenced by ~PRM(), getSystem(), and getSystem().

◆ _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 244 of file PRM.h.

Referenced by ~PRM(), and systems().

◆ _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 235 of file PRM.h.

Referenced by ~PRM(), isType(), type(), and type().

◆ _types_

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

Set of all PRMType in this PRM.

Definition at line 238 of file PRM.h.

Referenced by ~PRM(), and types().


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