49#ifndef GUM_MC_BAYES_NET_GENERATOR
50#define GUM_MC_BAYES_NET_GENERATOR
52#define NB_INIT_ITERATIONS 5000
166 template <
typename GUM_SCALAR,
167 template <
typename >
class ICPTGenerator = SimpleCPTGenerator,
168 template <
typename >
class ICPTDisturber = SimpleCPTDisturber >
171 public ICPTDisturber< GUM_SCALAR > {
237 void generateBN(BayesNet< GUM_SCALAR >& bayesNet)
override;
424#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Interface-like class for generating Bayesian networks.
#define NB_INIT_ITERATIONS
Source implementation of MCBayesNetGenerator.
IBayesNetGenerator(Size nbrNodes, Size maxArcs, Size maxModality)
<agrum/BN/generator/MCayesNetGenerator.h>
bool _isPolytree_()
The function that verify if graph is a polytree.
void _jump_multi_()
In the case that the graph is a multiconnect graph, the function will choose randomly two nodes and w...
void _createTree_(Size BNSize)
The function that randomly generate a simple tree.
bool _is_connected_(const NodeId i, const NodeId j, NodeSet &excluded)
The internal function used by the previous is_connected.
NodeId _createPartTree_(Size BNSize, Idx &n)
The internal function used by createTree that randomly generate a simple tree.
void setQ(Idx q)
Modifies the value of the probability q imposed on the BayesNetGenerator.
void _PMMx_multi_()
In the case that the graph is a multiconnected graph, the function will, according to the probability...
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 random arc by the use of the functi...
void _chooseCloseNodes_(NodeId &i, NodeId &j)
The function that randomly choose two neighbours nodes of the graph.
bool _connect_(NodeId i, NodeId j)
The function that verify if node i and j are connected.
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 _PMMx_poly_()
In the case that the graph is a polytree, the function will, according to the probability p and q,...
bool _directedPath_(NodeId tail, NodeId head)
The function that verify if there is a oriented path from node i to node j.
void _eraseArc_(NodeId i, NodeId j, bool mustbeconnex=true)
The function that will remove the arc between node i and node j.
void setIteration(Size iteration)
Modifies the value of the number of iterations impose on the BayesNetGenerator.
Idx q() const
Return a constant reference to the probabilité imposed on the Markov Chain BayesNetGenerator.
void generateBN(BayesNet< GUM_SCALAR > &bayesNet) override
Generates a random Bayesian network.
virtual bool _checkConditions_()
The boolean function that will assert the respect of the constraint.
MCBayesNetGenerator(Size nbrNodes, Size maxArcs, Idx maxModality=2, Size iteration=NB_INIT_ITERATIONS, Idx p=30, Idx q=40)
Constructor.
void setP(Idx p)
Modifies the value of the probability p imposed on the BayesNetGenerator.
Size iteration() const
Return a constant reference to the number of iteration imposed on the Markov Chain BayesNetGenerator.
void _Add_and_Remove_()
The function will remove and add a random arc changing the topology of the graph but asserting its co...
void _chooseNodes_(NodeId &i, NodeId &j)
The function that randomly choose two nodes of the graph.
Idx p() const
Return a constant reference to the probabilité p imposed on the Markov Chain BayesNetGenerator.
void _Add_or_Remove_()
The function will add or remove a random arc in the graph using the functions insertArc and removeArc...
~MCBayesNetGenerator() override
Destructor.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
Implementation of a Shafer-Shenoy's-like version of lazy propagation for inference in Bayesian networ...
gum is the global namespace for all aGrUM entities
Source implementation of SimpleCPTDisturber.