71 template < GUM_Numeric GUM_SCALAR >
290 using model_pair = std::pair< PRMClassElementContainer< GUM_SCALAR >*,
336 std::string_view
name,
342#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.
PRMObject(std::string_view name)
Constructor.
const std::string & name() const
Returns the name of this object.
prm_type
Enumeration of the different types of objects handled by a PRM.
PRMClassElementContainer< GUM_SCALAR > & getArrayType(std::string_view name)
Returns the type of the given array.
typename NodeProperty< PRMInstance< GUM_SCALAR > * >::const_iterator const_iterator
Constant Iterator over the PRMInstance of this PRMSystem.
PRMObject::prm_type obj_type() const override
Returns the PRM type of this object.
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.
void addArray(std::string_view array, PRMClassElementContainer< GUM_SCALAR > &type)
Add an array of instances in this system. If the array doesn't exists it is created.
const iterator & end()
Returns an iterator at the end of the set of PRMInstance in this PRMSystem.
void _groundAgg_(const PRMClassElement< GUM_SCALAR > &elt, std::string_view name, BayesNetFactory< GUM_SCALAR > &factory) const
Ground an aggregator with the given name in the grounded IBayesNet.
typename Sequence< PRMInstance< GUM_SCALAR > * >::const_iterator const_array_iterator
Iterator over the PRMInstance in an array in this PRMSystem.
~PRMSystem() override
Destructor.
iterator begin()
Returns an iterator over the instances in this system.
DiGraph skeleton_
The relational skeleton of this PRMSystem.
bool exists(std::string_view name) const
Retruns true either if name is an instance or an array in this PRMSystem.
PRMSystem(std::string_view name)
Default constructor.
typename NodeProperty< PRMInstance< GUM_SCALAR > * >::iterator iterator
Iterator over the PRMInstance of this PRMSystem.
HashTable< std::string, PRMInstance< GUM_SCALAR > * > nameMap_
The mapping between PRMInstance and their names.
const Sequence< PRMInstance< GUM_SCALAR > * > & getArray(std::string_view name) const
Returns the sequence of instances of a given array.
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.
PRMInstance< GUM_SCALAR > & get(NodeId id)
Returns an PRMInstance given it's NodeId in the relational skeleton.
const DiGraph & skeleton() const
Returns the relation skeleton 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.
Size size() const
Returns the number of PRMInstance in this PRMSystem.
void groundedBN(BayesNetFactory< GUM_SCALAR > &factory) const
Returns the grounded Bayesian network of this system.
bool isInstance(std::string_view name) const
Returns true if an PRMInstance with the given name exists.
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 instantiate()
Instantiate all the PRMInstance in this PRMSystem.
NodeId add(PRMInstance< GUM_SCALAR > *i)
Add an PRMInstance to this system.
bool isArray(std::string_view name) const
Returns true if an array with the given name exists.
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