![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
<agrum/BN/generator/MCayesNetGenerator.h> More...
#include <MCBayesNetGenerator.h>
Public Member Functions | |
Constructors / Destructor | |
| MCBayesNetGenerator (Size nbrNodes, Size maxArcs, Idx maxModality=2, Size iteration=NB_INIT_ITERATIONS, Idx p=30, Idx q=40) | |
| Constructor. | |
| MCBayesNetGenerator (BayesNet< GUM_SCALAR > bayesNet, Size iteration=NB_INIT_ITERATIONS, Idx p=30, Idx q=40) | |
| Constructor. | |
| ~MCBayesNetGenerator () override | |
| Destructor. | |
BN generation methods | |
| void | generateBN (BayesNet< GUM_SCALAR > &bayesNet) override |
| Generates a random Bayesian network. | |
Getters | |
| Size | iteration () const |
| Return a constant reference to the number of iteration imposed on the Markov Chain BayesNetGenerator. | |
| Idx | p () const |
| Return a constant reference to the probabilité p imposed on the Markov Chain BayesNetGenerator. | |
| Idx | q () const |
| Return a constant reference to the probabilité imposed on the Markov Chain BayesNetGenerator. | |
Setters | |
| void | setIteration (Size iteration) |
| Modifies the value of the number of iterations impose on the BayesNetGenerator. | |
| void | setP (Idx p) |
| Modifies the value of the probability p imposed on the BayesNetGenerator. | |
| void | setQ (Idx q) |
| Modifies the value of the probability q imposed on the BayesNetGenerator. | |
BN generation methods | |
| 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. | |
CPT generation methods | |
| void | generateCPT (const Idx &varId, const Tensor< GUM_SCALAR > &cpt) const override |
| Generates a CPT using floats. | |
CPT disturbing methods | |
| void | disturbReducCPT (NodeId node, BayesNet< GUM_SCALAR > &bayesNet, Tensor< GUM_SCALAR > &src, Tensor< GUM_SCALAR > &marg) override |
| Disturb a CPT using GUM_SCALAR when removing parent varIdi. | |
| void | disturbAugmCPT (NodeId node, BayesNet< GUM_SCALAR > &bayesNet, Tensor< GUM_SCALAR > &src, GUM_SCALAR variation) override |
| Disturb a CPT using GUM_SCALAR when inserting a new parent new_parent. | |
Protected Member Functions | |
| bool | _isPolytree_ () |
| The function that verify if graph is a polytree. | |
| bool | _connect_ (NodeId i, NodeId j) |
| The function that verify if node i and j are connected. | |
| bool | _directedPath_ (NodeId tail, NodeId head) |
| The function that verify if there is a oriented path from node i to node j. | |
| void | _insertArc_ (NodeId i, NodeId j) |
| The function that will insert an arc between node i to node j, but only if there isn't any cycle created. | |
| void | _eraseArc_ (NodeId i, NodeId j, bool mustbeconnex=true) |
| The function that will remove the arc between node i and node j. | |
| void | _PMMx_poly_ () |
| In the case that the graph is a polytree, the function will, according to the probability p and q, choose which change of state must occur (AorR or AR or jump) then will assert that the imposed constraints are respected and if not, will return to the previous topology. | |
| void | _PMMx_multi_ () |
| In the case that the graph is a multiconnected graph, the function will, according to the probability p and q, choose which change of state must occur (AorR or jump) then will assert that the imposed constraint are respected and if not, will return to the previous topology. | |
| void | _jump_poly_ () |
| In the case that the graph is a polytree, the function will add a random arc by the use of the function insertArc if the arc does not exist already. | |
| void | _jump_multi_ () |
| In the case that the graph is a multiconnect graph, the function will choose randomly two nodes and will remove the arc between them by the use of the function insertArc if the arc exists. | |
| void | _Add_or_Remove_ () |
| The function will add or remove a random arc in the graph using the functions insertArc and removeArc. | |
| void | _Add_and_Remove_ () |
| The function will remove and add a random arc changing the topology of the graph but asserting its connectivity. | |
| virtual bool | _checkConditions_ () |
| The boolean function that will assert the respect of the constraint. | |
| bool | _is_connected_ (const NodeId i, const NodeId j, NodeSet &excluded) |
| The internal function used by the previous is_connected. | |
| bool | _directedPath_ (NodeId tail, NodeId head, NodeSet &excluded) |
| The internal function used by the previous directedPath. | |
| void | _chooseNodes_ (NodeId &i, NodeId &j) |
| The function that randomly choose two nodes of the graph. | |
| void | _chooseCloseNodes_ (NodeId &i, NodeId &j) |
| The function that randomly choose two neighbours nodes of the graph. | |
| void | _transformPoly_ (Idx nbiter) |
| The function that randomly change the simple tree into a polytree. | |
| void | _createTree_ (Size BNSize) |
| The function that randomly generate a simple tree. | |
| NodeId | _createPartTree_ (Size BNSize, Idx &n) |
| The internal function used by createTree that randomly generate a simple tree. | |
Protected Attributes | |
| Size | iteration_ |
| Idx | p_ |
| Idx | q_ |
| Size | nbrNodes_ |
| Size | maxArcs_ |
| Size | maxModality_ |
| DAG | dag_ |
<agrum/BN/generator/MCayesNetGenerator.h>
Class for generating Bayesian networks with Markov chains.
This class randomly generates a Bayesian network given 6 parameters: the number of nodes, the maximum number of arcs the and of iterations the maximum modality.
This Generation method require the use of two probability parameters(p, q) defining the choice of processes that will provoke the change of state. You can see in the graph below how the probabilities are used.
Definition at line 169 of file MCBayesNetGenerator.h.
| gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::MCBayesNetGenerator | ( | Size | nbrNodes, |
| Size | maxArcs, | ||
| Idx | maxModality = 2, | ||
| Size | iteration = NB_INIT_ITERATIONS, | ||
| Idx | p = 30, | ||
| Idx | q = 40 ) |
Constructor.
Use by default the SimpleCPTGenerator for generating the BNs CPT and the SimpleCPTDisturber to tweak the CPT when the dimension of the table changes.
| nbrNodes | The number of nodes in the generated BN. |
| maxArcs | The maximum number of Arcs. |
| maxModality | Each DRV has from 2 to maxModality modalities |
| iteration | The number of iterations wanted to repeat the algorithm |
| p | probability for the change of the state (see use of p and q ) |
| q | probability for the change of the state (see use of p and q ) |
Definition at line 70 of file MCBayesNetGenerator_tpl.h.
References MCBayesNetGenerator(), GUM_ERROR, IBNG, iteration(), iteration_, gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::maxArcs(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::maxModality(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::nbrNodes(), p(), p_, q(), and q_.
Referenced by MCBayesNetGenerator(), MCBayesNetGenerator(), and ~MCBayesNetGenerator().
|
explicit |
Constructor.
Use by default the SimpleCPTGenerator for generating the BNs CPT and the SimpleCPTDisturber to tweak the CPT when the dimension of the table changes.
| bayesNet | the IBayesNet used as reference to fill the parameters nbrNodes, maxArcs and maxModality |
| iteration | The number of iterations wanted to repeat the algorithm |
| p | probability for the change of the state (see probability_p_q ) |
| q | probability for the change of the state (see probability_p_q ) |
Definition at line 91 of file MCBayesNetGenerator_tpl.h.
References MCBayesNetGenerator(), gum::getMaxModality(), iteration(), iteration_, p(), p_, q(), and q_.
|
override |
Destructor.
Definition at line 108 of file MCBayesNetGenerator_tpl.h.
References MCBayesNetGenerator().
|
protected |
The function will remove and add a random arc changing the topology of the graph but asserting its connectivity.
Definition at line 290 of file MCBayesNetGenerator_tpl.h.
References _chooseNodes_().
|
protected |
The function will add or remove a random arc in the graph using the functions insertArc and removeArc.
Definition at line 277 of file MCBayesNetGenerator_tpl.h.
References _chooseNodes_(), _eraseArc_(), _insertArc_(), and gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_.
|
protectedvirtual |
The boolean function that will assert the respect of the constraint.
Reimplemented in gum::MaxInducedWidthMCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >, and gum::MaxParentsMCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >.
Definition at line 182 of file MCBayesNetGenerator_tpl.h.
References gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, and gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::maxArcs_.
Referenced by gum::MaxParentsMCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_checkConditions_(), and _transformPoly_().
|
protected |
The function that randomly choose two neighbours nodes of the graph.
Definition at line 413 of file MCBayesNetGenerator_tpl.h.
References gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, and gum::randomValue().
Referenced by _transformPoly_().
|
protected |
The function that randomly choose two nodes of the graph.
Definition at line 398 of file MCBayesNetGenerator_tpl.h.
References gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_.
Referenced by _Add_and_Remove_(), _Add_or_Remove_(), and _jump_poly_().
|
protected |
The function that verify if node i and j are connected.
Definition at line 514 of file MCBayesNetGenerator_tpl.h.
References _is_connected_(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, gum::Set< Key >::exists(), and gum::Set< Key >::insert().
|
protected |
The internal function used by createTree that randomly generate a simple tree.
n : id number for node label
Definition at line 465 of file MCBayesNetGenerator_tpl.h.
References _createPartTree_(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, and gum::randomValue().
Referenced by _createPartTree_(), and _createTree_().
|
protected |
The function that randomly generate a simple tree.
Definition at line 447 of file MCBayesNetGenerator_tpl.h.
References _createPartTree_(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, and gum::randomValue().
Referenced by generateBN().
|
protected |
The function that verify if there is a oriented path from node i to node j.
Definition at line 560 of file MCBayesNetGenerator_tpl.h.
References _directedPath_(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, and gum::Set< Key >::insert().
Referenced by _directedPath_(), and _directedPath_().
|
protected |
The internal function used by the previous directedPath.
It asserts the existence of an oriented path between node i and node j avoiding passing through nodes listed in excluded.
Definition at line 578 of file MCBayesNetGenerator_tpl.h.
References _directedPath_(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, gum::Set< Key >::exists(), and gum::Set< Key >::insert().
|
protected |
The function that will remove the arc between node i and node j.
If the boolean parameter mustbeconnex is true, the function will assert that the graph remain connected and will restore the arc otherwise.
Definition at line 371 of file MCBayesNetGenerator_tpl.h.
Referenced by _Add_or_Remove_(), and _transformPoly_().
|
protected |
The function that will insert an arc between node i to node j, but only if there isn't any cycle created.
Definition at line 355 of file MCBayesNetGenerator_tpl.h.
Referenced by _Add_or_Remove_().
|
protected |
The internal function used by the previous is_connected.
It asserts the existence of an unoriented path between node i and node j avoiding passing through nodes listed in excluded.
Definition at line 536 of file MCBayesNetGenerator_tpl.h.
References _is_connected_(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_, gum::Set< Key >::exists(), and gum::Set< Key >::insert().
Referenced by _connect_(), and _is_connected_().
|
protected |
The function that verify if graph is a polytree.
Definition at line 507 of file MCBayesNetGenerator_tpl.h.
References gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_.
|
protected |
In the case that the graph is a multiconnect graph, the function will choose randomly two nodes and will remove the arc between them by the use of the function insertArc if the arc exists.
Definition at line 344 of file MCBayesNetGenerator_tpl.h.
|
protected |
In the case that the graph is a polytree, the function will add a random arc by the use of the function insertArc if the arc does not exist already.
Definition at line 334 of file MCBayesNetGenerator_tpl.h.
References _chooseNodes_().
|
protected |
In the case that the graph is a multiconnected graph, the function will, according to the probability p and q, choose which change of state must occur (AorR or jump) then will assert that the imposed constraint are respected and if not, will return to the previous topology.
Definition at line 235 of file MCBayesNetGenerator_tpl.h.
|
protected |
In the case that the graph is a polytree, the function will, according to the probability p and q, choose which change of state must occur (AorR or AR or jump) then will assert that the imposed constraints are respected and if not, will return to the previous topology.
Definition at line 192 of file MCBayesNetGenerator_tpl.h.
Referenced by generateBN().
|
protected |
The function that randomly change the simple tree into a polytree.
Definition at line 492 of file MCBayesNetGenerator_tpl.h.
References _checkConditions_(), _chooseCloseNodes_(), _eraseArc_(), and gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::dag_.
Referenced by generateBN().
|
overrideinherited |
Disturb a CPT using GUM_SCALAR when inserting a new parent new_parent.
| node | A reference on the CPT owner. |
| bayesNet | the Bayesian network. |
| src | copy of the CPT before augmentation. |
| variation | degree of variation from the initial probability. |
Definition at line 94 of file simpleCPTDisturber_tpl.h.
|
overrideinherited |
Disturb a CPT using GUM_SCALAR when removing parent varIdi.
| node | The variable on the CPT owner. |
| bayesNet | the Bayesian network. |
| src | copy of the CPT before reduction. |
| marg | of the inference before reduction on the node varIdi. |
Definition at line 70 of file simpleCPTDisturber_tpl.h.
References gum::Instantiation::end(), gum::Instantiation::setFirst(), and gum::Instantiation::setVals().
|
inherited |
function that insert random values in the CPT of each nodes according to the CPTGenerator.
Definition at line 130 of file IBayesNetGenerator_tpl.h.
References dag_, maxModality_, and gum::randomValue().
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::generateBN(), and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::generateBN().
|
inherited |
Virtual function that Generates a Bayesian networks.
| bayesNet | Bayesian network to be completed after initialisation |
Definition at line 122 of file IBayesNetGenerator_tpl.h.
References maxArcs(), and maxArcs_.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::generateBN(), and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::generateBN().
|
overridevirtual |
Generates a random Bayesian network.
| bayesNet | empty IBayesNet to generate. |
Implements gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >.
Definition at line 115 of file MCBayesNetGenerator_tpl.h.
References _createTree_(), _PMMx_poly_(), _transformPoly_(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::fillCPT(), gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::fromDAG(), iteration(), iteration_, and gum::IBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator >::nbrNodes_.
|
overrideinherited |
Generates a CPT using floats.
| varId | The variable id of the CPT owner. |
| cpt | A reference on the CPT to fill. |
Definition at line 72 of file simpleCPTGenerator_tpl.h.
| INLINE Size gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::iteration | ( | ) | const |
Return a constant reference to the number of iteration imposed on the Markov Chain BayesNetGenerator.
Definition at line 597 of file MCBayesNetGenerator_tpl.h.
References iteration_.
Referenced by MCBayesNetGenerator(), MCBayesNetGenerator(), generateBN(), and setIteration().
|
inherited |
Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator.
Definition at line 151 of file IBayesNetGenerator_tpl.h.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::MCBayesNetGenerator(), gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::SimpleBayesNetGenerator(), and fromDAG().
|
inherited |
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator.
Definition at line 157 of file IBayesNetGenerator_tpl.h.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::MCBayesNetGenerator(), gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::SimpleBayesNetGenerator(), and ~IBayesNetGenerator().
|
inherited |
Return a constant reference to the number of nodes imposed on the IBayesNetGenerator.
Definition at line 145 of file IBayesNetGenerator_tpl.h.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::MCBayesNetGenerator(), and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::SimpleBayesNetGenerator().
| INLINE Idx gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::p | ( | ) | const |
Return a constant reference to the probabilité p imposed on the Markov Chain BayesNetGenerator.
Definition at line 604 of file MCBayesNetGenerator_tpl.h.
References p_.
Referenced by MCBayesNetGenerator(), MCBayesNetGenerator(), and setP().
| INLINE Idx gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::q | ( | ) | const |
Return a constant reference to the probabilité imposed on the Markov Chain BayesNetGenerator.
Definition at line 611 of file MCBayesNetGenerator_tpl.h.
References q_.
Referenced by MCBayesNetGenerator(), MCBayesNetGenerator(), and setQ().
| INLINE void gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::setIteration | ( | Size | iteration | ) |
Modifies the value of the number of iterations impose on the BayesNetGenerator.
Definition at line 618 of file MCBayesNetGenerator_tpl.h.
References iteration(), and iteration_.
|
inherited |
Modifies the value of the number of nodes imposed on the BayesGenerator.
Definition at line 172 of file IBayesNetGenerator_tpl.h.
|
inherited |
Modifies the value of the number of nodes imposed on the BayesGenerator.
Definition at line 177 of file IBayesNetGenerator_tpl.h.
|
inherited |
Modifies the value of the number of nodes imposed on the BayesGenerator.
Definition at line 167 of file IBayesNetGenerator_tpl.h.
| INLINE void gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::setP | ( | Idx | p | ) |
Modifies the value of the probability p imposed on the BayesNetGenerator.
Definition at line 626 of file MCBayesNetGenerator_tpl.h.
References GUM_ERROR, p(), p_, and q_.
| INLINE void gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::setQ | ( | Idx | q | ) |
Modifies the value of the probability q imposed on the BayesNetGenerator.
Definition at line 637 of file MCBayesNetGenerator_tpl.h.
References GUM_ERROR, p_, q(), and q_.
|
protectedinherited |
Definition at line 187 of file IBayesNetGenerator.h.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_Add_or_Remove_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_checkConditions_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_chooseCloseNodes_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_chooseNodes_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_connect_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_createPartTree_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_createTree_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_directedPath_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_directedPath_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_is_connected_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_isPolytree_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_transformPoly_(), fillCPT(), and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::generateBN().
|
protected |
Definition at line 298 of file MCBayesNetGenerator.h.
Referenced by MCBayesNetGenerator(), MCBayesNetGenerator(), generateBN(), iteration(), and setIteration().
|
protectedinherited |
Definition at line 185 of file IBayesNetGenerator.h.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_checkConditions_(), fromDAG(), and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::generateBN().
|
protectedinherited |
Definition at line 186 of file IBayesNetGenerator.h.
Referenced by ~IBayesNetGenerator(), and fillCPT().
|
protectedinherited |
Definition at line 184 of file IBayesNetGenerator.h.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::generateBN(), and gum::SimpleBayesNetGenerator< GUM_SCALAR, ICPTGenerator >::generateBN().
|
protected |
Definition at line 299 of file MCBayesNetGenerator.h.
Referenced by MCBayesNetGenerator(), MCBayesNetGenerator(), p(), setP(), and setQ().
|
protected |
Definition at line 299 of file MCBayesNetGenerator.h.
Referenced by MCBayesNetGenerator(), MCBayesNetGenerator(), q(), setP(), and setQ().