55 template <
typename GUM_SCALAR >
56 class PRMSystem :
public PRMObject {
83 PRMInstance< GUM_SCALAR >&
get(
NodeId id);
90 const PRMInstance< GUM_SCALAR >&
get(
NodeId id)
const;
92 NodeId get(
const PRMInstance< GUM_SCALAR >& i)
const;
130 void groundedBN(BayesNetFactory< GUM_SCALAR >& factory)
const;
143 PRMInstance< GUM_SCALAR >&
get(
const std::string&
name);
147 const PRMInstance< GUM_SCALAR >&
get(
const std::string&
name)
const;
151 const Set< PRMInstance< GUM_SCALAR >* >&
152 get(
const PRMClass< GUM_SCALAR >& type)
const;
157 NodeId add(PRMInstance< GUM_SCALAR >* i);
167 const Sequence< PRMInstance< GUM_SCALAR >* >&
172 PRMClassElementContainer< GUM_SCALAR >&
177 const PRMClassElementContainer< GUM_SCALAR >&
186 NodeId add(
const std::string& array, PRMInstance< GUM_SCALAR >* i);
194 NodeId add(
const std::string& array, PRMInstance< GUM_SCALAR >& i);
200 void addArray(
const std::string& array,
201 PRMClassElementContainer< GUM_SCALAR >& type);
218 const iterator&
end();
238 array_iterator
begin(
const std::string& a);
243 const array_iterator&
end(
const std::string& a);
288 typedef std::pair< PRMClassElementContainer< GUM_SCALAR >*,
335 const std::string&
name,
341 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 352 #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.
Base classes for oriented graphs.
Unsafe Const Iterators for hashtablesHashTableConstIterator provides a fast but unsafe way to parse H...
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
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.
Headers of gum::prm::Class<GUM_SCALAR>.
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.
gum is the global namespace for all aGrUM entities
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.
Headers of the BayesNetFactory class.
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.
Headers of gum::prm::PRMInstance<GUM_SCALAR>
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.
Inline implementation of PRMSystem.
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.
Class hash tables iterators.
Size NodeId
Type for node ids.
A factory class to ease BayesNet construction.