![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Class for generating Bayesian networks. More...
#include <agrum/BN/generator/IBayesNetGenerator.h>
Public Member Functions | |
Constructors / Destructor | |
IBayesNetGenerator (Size nbrNodes, Size maxArcs, Size maxModality) | |
constructor. More... | |
virtual | ~IBayesNetGenerator () |
Destructor. More... | |
BN generation methods | |
virtual void | generateBN (BayesNet< GUM_SCALAR > &bayesNet)=0 |
Virtual function that Generates a Bayesian networks. More... | |
void | fillCPT () |
function that insert random values in the CPT of each nodes according to the CPTGenerator. More... | |
Getters | |
Size | nbrNodes () const |
Return a constant reference to the number of nodes imposed on the IBayesNetGenerator. More... | |
Size | maxArcs () const |
Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator. More... | |
Size | maxModality () const |
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator. More... | |
Setters | |
void | setNbrNodes (Size nbrNodes) |
Modifies the value of the number of nodes imposed on the BayesGenerator. More... | |
void | setMaxArcs (Size maxArcs) |
Modifies the value of the number of nodes imposed on the BayesGenerator. More... | |
void | setMaxModality (Size maxModality) |
Modifies the value of the number of nodes imposed on the BayesGenerator. More... | |
Protected Attributes | |
Size | nbrNodes_ |
Size | maxArcs_ |
Size | maxModality_ |
BayesNet< GUM_SCALAR > | bayesNet_ |
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 62 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 37 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
Destructor.
Definition at line 56 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
void gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::fillCPT | ( | ) |
function that insert random values in the CPT of each nodes according to the CPTGenerator.
Definition at line 62 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
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 >, and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >.
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 78 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE Size gum::IBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::maxModality | ( | ) | const |
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator.
Definition at line 68 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
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 73 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
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 98 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
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 83 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
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 90 of file IBayesNetGenerator_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
Definition at line 166 of file IBayesNetGenerator.h.
|
protected |
Definition at line 164 of file IBayesNetGenerator.h.
|
protected |
Definition at line 165 of file IBayesNetGenerator.h.
|
protected |
Definition at line 163 of file IBayesNetGenerator.h.