![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Class for generating Bayesian networks. More...
#include <agrum/BN/generator/IBayesNetGenerator.h>
Inherits gum::ICPTGenerator< GUM_SCALAR >.
Public Member Functions | |
Constructors / Destructor | |
| IBayesNetGenerator (Size nbrNodes, Size maxArcs, Size maxModality) | |
| constructor. | |
| virtual | ~IBayesNetGenerator () |
| Destructor. | |
BN generation methods | |
| virtual void | generateBN (BayesNet< GUM_SCALAR > &bayesNet)=0 |
| Virtual function that Generates a Bayesian networks. | |
| void | fromDAG (BayesNet< GUM_SCALAR > &bayesNet) |
| Virtual function that Generates a Bayesian networks. | |
| void | fillCPT (BayesNet< GUM_SCALAR > &bn) const |
| function that insert random values in the CPT of each nodes according to the CPTGenerator. | |
Getters | |
| Size | nbrNodes () const |
| Return a constant reference to the number of nodes imposed on the IBayesNetGenerator. | |
| Size | maxArcs () const |
| Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator. | |
| Size | maxModality () const |
| Return a constant reference to the maximum modality imposed on the IBayesNetGenerator. | |
Setters | |
| void | setNbrNodes (Size nbrNodes) |
| Modifies the value of the number of nodes imposed on the BayesGenerator. | |
| void | setMaxArcs (Size maxArcs) |
| Modifies the value of the number of nodes imposed on the BayesGenerator. | |
| void | setMaxModality (Size maxModality) |
| Modifies the value of the number of nodes imposed on the BayesGenerator. | |
Protected Attributes | |
| Size | nbrNodes_ |
| Size | maxArcs_ |
| Size | maxModality_ |
| DAG | dag_ |
Class for generating Bayesian networks.
This class is the abstract class for randomly generating a bayesian network given three parameters: the number of nodes the wanted maximum number of arcs and the maximum number of modality for each node.
Definition at line 81 of file IBayesNetGenerator.h.
| INLINE gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::IBayesNetGenerator | ( | Size | nbrNodes, |
| Size | maxArcs, | ||
| Size | maxModality ) |
constructor.
Use by default the SimpleCPTGenerator for generating the BNs CPT.
| nbrNodes | The number of nodes in the generated BN. |
| maxArcs | The number of maximum number of arcs imposed on the generator |
| maxModality | Each DRV has from 2 to maxModality modalities |
| OperationNotAllowed | if the number of maximum arcs does not allow the generation of a connexe graph maxArcs < nbrNodes -1, is too big maxArcs > nbrNodes *(nbrNodes -1) /2 and if the maximum of modality is lower than 2. |
Definition at line 58 of file IBayesNetGenerator_tpl.h.
References IBayesNetGenerator(), dag_, GUM_ERROR, maxArcs(), maxArcs_, maxModality(), maxModality_, nbrNodes(), and nbrNodes_.
Referenced by IBayesNetGenerator(), ~IBayesNetGenerator(), fromDAG(), and setNbrNodes().
|
virtual |
Destructor.
Definition at line 76 of file IBayesNetGenerator_tpl.h.
References IBayesNetGenerator().
| void gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::fillCPT | ( | BayesNet< GUM_SCALAR > & | bn | ) | const |
function that insert random values in the CPT of each nodes according to the CPTGenerator.
Definition at line 82 of file IBayesNetGenerator_tpl.h.
| INLINE void gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::fromDAG | ( | BayesNet< GUM_SCALAR > & | bayesNet | ) |
Virtual function that Generates a Bayesian networks.
| bayesNet | Bayesian network to be completed after initialisation |
Definition at line 127 of file IBayesNetGenerator_tpl.h.
References IBayesNetGenerator(), and fromDAG().
Referenced by fromDAG().
|
pure virtual |
Virtual function that Generates a Bayesian networks.
| bayesNet | Bayesian network to be completed after initialisation |
Implemented in gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >, gum::MCBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator, SimpleCPTDisturber >, and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >.
References maxArcs(), maxModality(), and nbrNodes().
| INLINE Size gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::maxArcs | ( | ) | const |
Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator.
Definition at line 98 of file IBayesNetGenerator_tpl.h.
References maxArcs_.
Referenced by IBayesNetGenerator(), generateBN(), and setMaxArcs().
| INLINE Size gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::maxModality | ( | ) | const |
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator.
Definition at line 88 of file IBayesNetGenerator_tpl.h.
References maxModality_.
Referenced by IBayesNetGenerator(), generateBN(), and setMaxModality().
| INLINE Size gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::nbrNodes | ( | ) | const |
Return a constant reference to the number of nodes imposed on the IBayesNetGenerator.
Definition at line 93 of file IBayesNetGenerator_tpl.h.
References nbrNodes_.
Referenced by IBayesNetGenerator(), generateBN(), and setNbrNodes().
| INLINE void gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::setMaxArcs | ( | Size | maxArcs | ) |
Modifies the value of the number of nodes imposed on the BayesGenerator.
Definition at line 119 of file IBayesNetGenerator_tpl.h.
References GUM_ERROR, maxArcs(), and nbrNodes_.
| INLINE void gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::setMaxModality | ( | Size | maxModality | ) |
Modifies the value of the number of nodes imposed on the BayesGenerator.
Definition at line 103 of file IBayesNetGenerator_tpl.h.
References GUM_ERROR, and maxModality().
| INLINE void gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::setNbrNodes | ( | Size | nbrNodes | ) |
Modifies the value of the number of nodes imposed on the BayesGenerator.
Definition at line 111 of file IBayesNetGenerator_tpl.h.
References IBayesNetGenerator(), GUM_ERROR, maxArcs_, nbrNodes(), nbrNodes_, and setNbrNodes().
Referenced by setNbrNodes().
|
protected |
Definition at line 187 of file IBayesNetGenerator.h.
Referenced by IBayesNetGenerator().
|
protected |
Definition at line 185 of file IBayesNetGenerator.h.
Referenced by IBayesNetGenerator(), maxArcs(), and setNbrNodes().
|
protected |
Definition at line 186 of file IBayesNetGenerator.h.
Referenced by IBayesNetGenerator(), and maxModality().
|
protected |
Definition at line 184 of file IBayesNetGenerator.h.
Referenced by IBayesNetGenerator(), nbrNodes(), setMaxArcs(), and setNbrNodes().