58 template <
typename GUM_SCALAR >
59 class PRMSystem :
public PRMObject {
86 PRMInstance< GUM_SCALAR >&
get(
NodeId id);
93 const PRMInstance< GUM_SCALAR >&
get(
NodeId id)
const;
95 NodeId get(
const PRMInstance< GUM_SCALAR >& i)
const;
133 void groundedBN(BayesNetFactory< GUM_SCALAR >& factory)
const;
146 PRMInstance< GUM_SCALAR >&
get(
const std::string&
name);
150 const PRMInstance< GUM_SCALAR >&
get(
const std::string&
name)
const;
154 const Set< PRMInstance< GUM_SCALAR >* >&
155 get(
const PRMClass< GUM_SCALAR >& type)
const;
160 NodeId add(PRMInstance< GUM_SCALAR >* i);
170 const Sequence< PRMInstance< GUM_SCALAR >* >&
175 PRMClassElementContainer< GUM_SCALAR >&
180 const PRMClassElementContainer< GUM_SCALAR >&
189 NodeId add(
const std::string& array, PRMInstance< GUM_SCALAR >* i);
197 NodeId add(
const std::string& array, PRMInstance< GUM_SCALAR >& i);
203 void addArray(
const std::string& array,
204 PRMClassElementContainer< GUM_SCALAR >& type);
221 const iterator&
end();
241 array_iterator
begin(
const std::string& a);
246 const array_iterator&
end(
const std::string& a);
291 typedef std::pair< PRMClassElementContainer< GUM_SCALAR >*,
338 const std::string&
name,
344 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 355 #endif // GUM_SYSTEM_H void __groundPotential(const PRMInstance< GUM_SCALAR > &instance, const PRMAttribute< GUM_SCALAR > &attr, BayesNetFactory< GUM_SCALAR > &factory) const
Method which copy node's Potential of an PRMInstance to the grounded Bayesian Network.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Unsafe Const Iterators for hashtablesHashTableConstIterator provides a fast but unsafe way to parse H...
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.
const std::string & name() const
Returns the name of this object.
PRMClassElementContainer< GUM_SCALAR > & getArrayType(const std::string &name)
Returns the type of the given array.
iterator begin()
Returns an iterator over the instances in this system.
virtual ~PRMSystem()
Destructor.
An PRMInstance is a Bayesian Network fragment defined by a Class and used in a PRMSystem.
NodeProperty< PRMInstance< GUM_SCALAR > *>::iterator iterator
Iterator over the PRMInstance of this PRMSystem.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Unsafe Iterators for hashtablesHashTableIterator provides a fast but unsafe way to parse HashTables...
bool isInstantiated(const PRMClass< GUM_SCALAR > &c) const
Returns true if the given Class<GUM_SCALAR> has at least one PRMInstance in this PRMSystem.
The generic class for storing (ordered) sequences of objects.
Abstract class representing an element of PRM class.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for generic Hash Tables.
PRMSystem(const std::string &name)
Default constructor.
NodeId add(PRMInstance< GUM_SCALAR > *i)
Add an PRMInstance to this system.
Representation of a setA Set is a structure that contains arbitrary elements.
PRMSystem< GUM_SCALAR > & operator=(const PRMSystem< GUM_SCALAR > &from)
Copy operator. Don't use it.
const DiGraph & skeleton() const
Returns the relation skeleton of this PRMSystem.
prm_type
Enumeration of the different types of objects handled by a PRM.
bool isInstance(const std::string &name) const
Returns true if an PRMInstance with the given name exists.
virtual PRMObject::prm_type obj_type() const
Returns the PRM type of this object.
void __groundAgg(const PRMClassElement< GUM_SCALAR > &elt, const std::string &name, BayesNetFactory< GUM_SCALAR > &factory) const
Ground an aggregator with the given name in the grounded IBayesNet.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTable< PRMClass< GUM_SCALAR > *, Set< PRMInstance< GUM_SCALAR > *> *> __instanceMap
Mapping between a class and all it's PRMInstance in this system.
NodeProperty< PRMInstance< GUM_SCALAR > *>::const_iterator const_iterator
Constant Iterator over the PRMInstance of this PRMSystem.
void groundedBN(BayesNetFactory< GUM_SCALAR > &factory) const
Returns the grounded Bayesian Network of this system.
DiGraph __skeleton
The relational skeleton of this PRMSystem.
Base class for all oriented graphs.
A PRMSystem is a container of PRMInstance and describe a relational skeleton.
HashTable< std::string, PRMInstance< GUM_SCALAR > *> __nameMap
The mapping between PRMInstance and their names.
Sequence< PRMInstance< GUM_SCALAR > *>::iterator array_iterator
Iterator over the PRMInstance in an array in this PRMSystem.
void instantiate()
Instantiate all the PRMInstance in this PRMSystem.
std::pair< PRMClassElementContainer< GUM_SCALAR > *, Sequence< PRMInstance< GUM_SCALAR > *> *> model_pair
Typedef of the pair of a Class<GUM_SCALAR> and the sequence of it's instantiation.
Sequence< PRMInstance< GUM_SCALAR > *>::const_iterator const_array_iterator
Iterator over the PRMInstance in an array in this PRMSystem.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool exists(const std::string &name) const
Retruns true either if name is an instance or an array in this PRMSystem.
void __groundRef(const PRMInstance< GUM_SCALAR > &instance, BayesNetFactory< GUM_SCALAR > &factory) const
Method which ground PRMReferenceSlot of an PRMInstance and add arcs in the IBayesNet.
Size size() const
Returns the number of PRMInstance in this PRMSystem.
bool isArray(const std::string &name) const
Returns true if an array with the given name exists.
const Sequence< PRMInstance< GUM_SCALAR > *> & getArray(const std::string &name) const
Returns the sequence of instances of a given array.
NodeProperty< PRMInstance< GUM_SCALAR > *> __nodeIdMap
The maping between PRMInstance and their NodeId in the relational skeleton of this PRMSystem...
PRMAttribute is a member of a Class in a PRM.
HashTable< std::string, model_pair > __arrayMap
Mapping between arrays and their name. The first element of the pair is the type of the array...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
const iterator & end()
Returns a iterator at the end of the set of PRMInstance in this PRMSystem.
void __groundAttr(const PRMInstance< GUM_SCALAR > &instance, BayesNetFactory< GUM_SCALAR > &factory) const
Method which ground Atttributes and Aggregators of an PRMInstance.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void addArray(const std::string &array, PRMClassElementContainer< GUM_SCALAR > &type)
Add an array of instances in this system. If the array doesn't exists it is created.
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.
Size NodeId
Type for node ids.
A factory class to ease BayesNet construction.