![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
<agrum/PRM/generator/layerGenerator.h> More...
#include <layerGenerator.h>
Classes | |
| struct | LayerData |
| Getters and setters. More... | |
| struct | MyData |
Public Member Functions | |
Constructors and destructor. | |
| LayerGenerator () | |
| Default constructor. | |
| LayerGenerator (const LayerGenerator &source) | |
| Copy constructor. | |
| LayerGenerator & | operator= (const LayerGenerator &source) |
| Copy operator. | |
| virtual | ~LayerGenerator () |
| Destructor. | |
| Size | getDomainSize () const |
| Returns the domain size of generated types. | |
| void | setDomainSize (Size s) |
| Set the domain size of generated types. | |
| Size | getMaxParents () const |
| Returns the max number of parents allowed for any attribute or aggregator. | |
| void | setMaxParents (Size s) |
| Returns the max number of parents allowed for any attribute or aggregator. | |
| void | setLayers (const std::vector< LayerData > &v) |
| Defines the structure of each layers. | |
| std::vector< LayerData > & | getLayer () |
| Returns the domain size of generated types. | |
| const std::vector< LayerData > & | getLayer () const |
| Returns the domain size of generated types. | |
| virtual PRM< GUM_SCALAR > * | generate () |
| Proceeds with the generation of the PRM<GUM_SCALAR>. | |
| void | setNameGenerator (const NameGenerator &name_gen) |
| Getters and setters. | |
| const NameGenerator & | getNameGenerator () const |
| Returns the NameGenerator used by this generator. | |
Protected Attributes | |
| NameGenerator | name_gen_ |
| The name generator used by this class. | |
Private Member Functions | |
| std::string | _generateType_ (PRMFactory< GUM_SCALAR > &f) |
| void | _generateInterfaces_ (PRMFactory< GUM_SCALAR > &f, const std::string &type, std::vector< MyData > &l) |
| void | _generateClasses_ (PRMFactory< GUM_SCALAR > &f, const std::string &type, std::vector< typename LayerGenerator::MyData > &l) |
| void | _generateClassDag_ (Size lvl, DAG &dag, Bijection< std::string, NodeId > &names, std::vector< typename LayerGenerator::MyData > &l) |
| void | _generateSystem_ (PRMFactory< GUM_SCALAR > &factory, std::vector< typename LayerGenerator::MyData > &l) |
Private Attributes | |
| std::vector< LayerData > | _layers_ |
| Size | _domain_size_ |
| Size | _max_parents_ |
<agrum/PRM/generator/layerGenerator.h>
This class generates PRMs with a layer structure.
Definition at line 73 of file layerGenerator.h.
| INLINE gum::prm::LayerGenerator< GUM_SCALAR >::LayerGenerator | ( | ) |
Default constructor.
Definition at line 279 of file layerGenerator_tpl.h.
References LayerGenerator(), _domain_size_, _layers_, and _max_parents_.
Referenced by LayerGenerator(), LayerGenerator(), ~LayerGenerator(), and operator=().
| INLINE gum::prm::LayerGenerator< GUM_SCALAR >::LayerGenerator | ( | const LayerGenerator< GUM_SCALAR > & | source | ) |
Copy constructor.
Definition at line 286 of file layerGenerator_tpl.h.
References LayerGenerator(), _domain_size_, _layers_, and _max_parents_.
|
virtual |
Destructor.
Definition at line 293 of file layerGenerator_tpl.h.
References LayerGenerator().
|
private |
Definition at line 183 of file layerGenerator_tpl.h.
References _layers_, gum::DAG::addArc(), gum::NodeGraphPart::addNode(), gum::ArcGraphPart::eraseArc(), gum::ArcGraphPart::existsArc(), getMaxParents(), gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::insert(), gum::NodeGraphPart::nodes(), gum::ArcGraphPart::parents(), gum::randomProba(), gum::randomValue(), gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::second(), and gum::Set< Key >::size().
Referenced by _generateClasses_().
|
private |
Definition at line 114 of file layerGenerator_tpl.h.
References _generateClassDag_(), _layers_, gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFactory< GUM_SCALAR >::addParent(), gum::prm::PRMFactory< GUM_SCALAR >::addReferenceSlot(), gum::prm::PRMObject::CLASS, gum::prm::PRMFactory< GUM_SCALAR >::endAttribute(), gum::prm::PRMFactory< GUM_SCALAR >::endClass(), gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::first(), getDomainSize(), gum::Set< Key >::insert(), gum::prm::PRMGenerator< GUM_SCALAR >::name_gen_, gum::ArcGraphPart::parents(), gum::randomValue(), gum::prm::PRMFactory< GUM_SCALAR >::retrieveClass(), gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::second(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByLines(), gum::prm::PRMFactory< GUM_SCALAR >::startAttribute(), and gum::prm::PRMFactory< GUM_SCALAR >::startClass().
Referenced by generate().
|
private |
Definition at line 85 of file layerGenerator_tpl.h.
References _layers_, gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), gum::prm::PRMFactory< GUM_SCALAR >::addReferenceSlot(), gum::prm::PRMObject::CLASS_ELT, gum::prm::PRMFactory< GUM_SCALAR >::endInterface(), gum::prm::PRMGenerator< GUM_SCALAR >::name_gen_, gum::prm::PRMObject::PRM_INTERFACE, and gum::prm::PRMFactory< GUM_SCALAR >::startInterface().
Referenced by generate().
|
private |
Definition at line 233 of file layerGenerator_tpl.h.
References _layers_, gum::prm::PRMFactory< GUM_SCALAR >::addInstance(), gum::prm::PRMFactory< GUM_SCALAR >::endSystem(), getMaxParents(), gum::prm::PRMGenerator< GUM_SCALAR >::name_gen_, gum::prm::PRMObject::PRM_INTERFACE, gum::randomProba(), gum::randomValue(), gum::prm::PRMFactory< GUM_SCALAR >::setReferenceSlot(), gum::prm::PRMFactory< GUM_SCALAR >::startSystem(), and gum::prm::PRMObject::SYSTEM.
Referenced by generate().
|
private |
Definition at line 70 of file layerGenerator_tpl.h.
References _domain_size_, gum::prm::PRMFactory< GUM_SCALAR >::addLabel(), gum::prm::PRMFactory< GUM_SCALAR >::endDiscreteType(), gum::prm::PRMGenerator< GUM_SCALAR >::name_gen_, gum::prm::PRMFactory< GUM_SCALAR >::startDiscreteType(), and gum::prm::PRMObject::TYPE.
Referenced by generate().
|
virtual |
Proceeds with the generation of the PRM<GUM_SCALAR>.
Implements gum::prm::PRMGenerator< GUM_SCALAR >.
Definition at line 55 of file layerGenerator_tpl.h.
References _generateClasses_(), _generateInterfaces_(), _generateSystem_(), _generateType_(), _layers_, GUM_ERROR, and gum::prm::PRMFactory< GUM_SCALAR >::prm().
| INLINE Size gum::prm::LayerGenerator< GUM_SCALAR >::getDomainSize | ( | ) | const |
Returns the domain size of generated types.
Definition at line 307 of file layerGenerator_tpl.h.
References _domain_size_.
Referenced by _generateClasses_().
| INLINE std::vector< typename LayerGenerator< GUM_SCALAR >::LayerData > & gum::prm::LayerGenerator< GUM_SCALAR >::getLayer | ( | ) |
Returns the domain size of generated types.
Definition at line 334 of file layerGenerator_tpl.h.
References _layers_.
| INLINE const std::vector< typename LayerGenerator< GUM_SCALAR >::LayerData > & gum::prm::LayerGenerator< GUM_SCALAR >::getLayer | ( | ) | const |
Returns the domain size of generated types.
Definition at line 340 of file layerGenerator_tpl.h.
References _layers_.
| INLINE Size gum::prm::LayerGenerator< GUM_SCALAR >::getMaxParents | ( | ) | const |
Returns the max number of parents allowed for any attribute or aggregator.
Definition at line 317 of file layerGenerator_tpl.h.
References _max_parents_.
Referenced by _generateClassDag_(), and _generateSystem_().
|
inherited |
Returns the NameGenerator used by this generator.
Definition at line 76 of file PRMGenerator_tpl.h.
References name_gen_.
| INLINE LayerGenerator< GUM_SCALAR > & gum::prm::LayerGenerator< GUM_SCALAR >::operator= | ( | const LayerGenerator< GUM_SCALAR > & | source | ) |
Copy operator.
Definition at line 299 of file layerGenerator_tpl.h.
References LayerGenerator(), _domain_size_, _layers_, and _max_parents_.
| INLINE void gum::prm::LayerGenerator< GUM_SCALAR >::setDomainSize | ( | Size | s | ) |
Set the domain size of generated types.
Definition at line 312 of file layerGenerator_tpl.h.
References _domain_size_.
| INLINE void gum::prm::LayerGenerator< GUM_SCALAR >::setLayers | ( | const std::vector< LayerData > & | v | ) |
Defines the structure of each layers.
Each value in v defines a layer, were v[i].first is the number of different classes in the i-th layer and v[i].second is the number of instances in the i-th layer.
| v | A vector describing each layer. |
Definition at line 327 of file layerGenerator_tpl.h.
References _layers_.
| INLINE void gum::prm::LayerGenerator< GUM_SCALAR >::setMaxParents | ( | Size | s | ) |
Returns the max number of parents allowed for any attribute or aggregator.
Definition at line 322 of file layerGenerator_tpl.h.
References _max_parents_.
|
inherited |
Getters and setters.
Defines the NameGenerator used by this generator.
Definition at line 71 of file PRMGenerator_tpl.h.
References name_gen_.
|
private |
Definition at line 146 of file layerGenerator.h.
Referenced by LayerGenerator(), LayerGenerator(), _generateType_(), getDomainSize(), operator=(), and setDomainSize().
|
private |
Definition at line 145 of file layerGenerator.h.
Referenced by LayerGenerator(), LayerGenerator(), _generateClassDag_(), _generateClasses_(), _generateInterfaces_(), _generateSystem_(), generate(), getLayer(), getLayer(), operator=(), and setLayers().
|
private |
Definition at line 147 of file layerGenerator.h.
Referenced by LayerGenerator(), LayerGenerator(), getMaxParents(), operator=(), and setMaxParents().
|
protectedinherited |
The name generator used by this class.
Definition at line 101 of file PRMGenerator.h.
Referenced by PRMGenerator(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClass_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClasses_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateCluster_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateInterfaces_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateInterfaces_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateSystem_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateSystem_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateType_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateType_(), getNameGenerator(), and setNameGenerator().