69 template <
typename GUM_SCALAR >
288 using model_pair = std::pair< PRMClassElementContainer< GUM_SCALAR >*,
334 const std::string&
name,
340#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Headers of the BayesNetFactory class.
Headers of gum::prm::PRMInstance<GUM_SCALAR>.
Inline implementation of PRMSystem.
A factory class to ease BayesNet construction.
Base class for all oriented graphs.
The class for generic Hash Tables.
The generic class for storing (ordered) sequences of objects.
PRMAttribute is a member of a Class in a PRM.
<agrum/PRM/classElementContainer.h>
Abstract class representing an element of PRM class.
A PRMClass is an object of a PRM representing a fragment of a Bayesian network which can be instantia...
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
const std::string & name() const
Returns the name of this object.
prm_type
Enumeration of the different types of objects handled by a PRM.
PRMObject(const std::string &name)
Constructor.
typename NodeProperty< PRMInstance< GUM_SCALAR > * >::const_iterator const_iterator
Constant Iterator over the PRMInstance of this PRMSystem.
bool isInstantiated(const PRMClass< GUM_SCALAR > &c) const
Returns true if the given Class<GUM_SCALAR> has at least one PRMInstance in this PRMSystem.
HashTable< PRMClass< GUM_SCALAR > *, Set< PRMInstance< GUM_SCALAR > * > * > instanceMap_
Mapping between a class and all it's PRMInstance in this system.
typename Sequence< PRMInstance< GUM_SCALAR > * >::iterator array_iterator
Iterator over the PRMInstance in an array in this PRMSystem.
const DiGraph & skeleton() const
Returns the relation skeleton of this PRMSystem.
iterator begin()
Returns an iterator over the instances in this system.
typename Sequence< PRMInstance< GUM_SCALAR > * >::const_iterator const_array_iterator
Iterator over the PRMInstance in an array in this PRMSystem.
PRMInstance< GUM_SCALAR > & get(NodeId id)
Returns an PRMInstance given it's NodeId in the relational skeleton.
void instantiate()
Instantiate all the PRMInstance in this PRMSystem.
const iterator & end()
Returns a iterator at the end of the set of PRMInstance in this PRMSystem.
PRMSystem(const std::string &name)
Default constructor.
Size size() const
Returns the number of PRMInstance in this PRMSystem.
bool isInstance(const std::string &name) const
Returns true if an PRMInstance with the given name exists.
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.
bool exists(const std::string &name) const
Retruns true either if name is an instance or an array in this PRMSystem.
DiGraph skeleton_
The relational skeleton of this PRMSystem.
typename NodeProperty< PRMInstance< GUM_SCALAR > * >::iterator iterator
Iterator over the PRMInstance of this PRMSystem.
const Sequence< PRMInstance< GUM_SCALAR > * > & getArray(const std::string &name) const
Returns the sequence of instances of a given array.
HashTable< std::string, PRMInstance< GUM_SCALAR > * > nameMap_
The mapping between PRMInstance and their names.
void _groundTensor_(const PRMInstance< GUM_SCALAR > &instance, const PRMAttribute< GUM_SCALAR > &attr, BayesNetFactory< GUM_SCALAR > &factory) const
Method which copy node's Tensor of an PRMInstance to the grounded Bayesian network.
bool isArray(const std::string &name) const
Returns true if an array with the given name exists.
virtual ~PRMSystem()
Destructor.
void groundedBN(BayesNetFactory< GUM_SCALAR > &factory) const
Returns the grounded Bayesian network of this system.
std::pair< PRMClassElementContainer< GUM_SCALAR > *, Sequence< PRMInstance< GUM_SCALAR > * > * > model_pair
Type for the pair of a Class<GUM_SCALAR> and the sequence of it's instantiation.
PRMSystem< GUM_SCALAR > & operator=(const PRMSystem< GUM_SCALAR > &from)=delete
Copy operator. Don't use it.
NodeProperty< PRMInstance< GUM_SCALAR > * > nodeIdMap_
The mapping between PRMInstance and their NodeId in the relational skeleton of this PRMSystem.
HashTable< std::string, model_pair > arrayMap_
Mapping between arrays and their name. The first element of the pair is the type of the array.
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.
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.
NodeId add(PRMInstance< GUM_SCALAR > *i)
Add an PRMInstance to this system.
PRMClassElementContainer< GUM_SCALAR > & getArrayType(const std::string &name)
Returns the type of the given array.
virtual PRMObject::prm_type obj_type() const
Returns the PRM type of this object.
void _groundAttr_(const PRMInstance< GUM_SCALAR > &instance, BayesNetFactory< GUM_SCALAR > &factory) const
Method which ground Atttributes and Aggregators of an PRMInstance.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Base class for integer discrete random variables.
namespace for all probabilistic relational models entities
gum is the global namespace for all aGrUM entities