30 #ifndef GUM_MC_BAYES_NET_GENERATOR 31 #define GUM_MC_BAYES_NET_GENERATOR 157 template <
typename GUM_SCALAR,
158 template <
typename >
class ICPTGenerator = SimpleCPTGenerator,
159 template <
typename >
class ICPTDisturber = SimpleCPTDisturber >
162 ,
public ICPTDisturber< GUM_SCALAR > {
427 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 434 #endif // MCBAYESNETGENERATOR Class representing a Bayesian Network.
MCBayesNetGenerator(Size nbrNodes, Size maxArcs, Idx maxModality=2, Size iteration=5000, Idx p=30, Idx q=40)
Constructor.
virtual bool __checkConditions()
The boolean function that will assert the respect of the constraint.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __PMMx_poly()
In the case that the graph is a polytree, the function will, according to the probability p and q...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Idx q() const
Return a constant reference to the probabilité imposed on the Markov Chain BayesNetGenerator.
<agrum/BN/generator/MCayesNetGenerator.h>
Class for generating bayesian networks.
bool __connect(NodeId i, NodeId j)
The function that verify if node i and j are connected.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setQ(Idx q)
Modifies the value of the probability q imposed on the BayesNetGenerator.
Size nbrNodes() const
Return a constant reference to the number of nodes imposed on the IBayesNetGenerator.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for generic Hash Tables.
void __jump_multi()
In the case that the graph is a multiconnect graph, the function will choose randomly two nodes and w...
bool __isPolytree()
The function that verify if graph is a polytree.
void setP(Idx p)
Modifies the value of the probability p imposed on the BayesNetGenerator.
~MCBayesNetGenerator() override
Destructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size maxArcs() const
Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator.
BayesNet< GUM_SCALAR > _bayesNettemp
void __transformPoly(Idx nbiter)
The function that randomly change the simple tree into a polytree.
void __jump_poly()
In the case that the graph is a polytree, the function will add a ramdom arc by the use of the functi...
NodeId __createPartTree(Size BNSize, Idx &n)
The internal function used by __createTree that randomly generate a simple tree.
void setIteration(Size iteration)
Modifies the value of the number of iterations impose on the BayesNetGenerator.
void disturbBN(BayesNet< GUM_SCALAR > &bayesNetinit, Size iteration=0)
Change randomly the topology of a specific bayesian networks.
void __chooseNodes(NodeId &i, NodeId &j)
The function that randomly choose two nodes of the graph.
void __AR()
The function will remove and add a random arc changing the topology of the graph but asserting its co...
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 crea...
void generateBN(BayesNet< GUM_SCALAR > &bayesNet) override
Generates a random bayesian network.
void __eraseArc(NodeId i, NodeId j, bool mustbeconnex=true)
The function that will remove the arc between node i and node j.
void __chooseCloseNodes(NodeId &i, NodeId &j)
The function that randomly choose two neighbours nodes of the graph.
Size Idx
Type for indexes.
void __AorR()
The function will add or remove a random arc in the graph using the functions __insertArc and __remov...
Size iteration() const
Return a constant reference to the number of iteration imposed on the Markov Chain BayesNetGenerator...
void __PMMx_multi()
In the case that the graph is a multiconnected graph, the function will, according to the probability...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool __directedPath(NodeId tail, NodeId head)
The function that verify if there is a oriented path from node i to node j.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __createTree(Size BNSize)
The function that randomly generate a simple tree.
Idx p() const
Return a constant reference to the probabilité p imposed on the Markov Chain BayesNetGenerator.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size NodeId
Type for node ids.
Size maxModality() const
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator.
HashTable< NodeId, Potential< GUM_SCALAR > *> _hashMarginal