56 template <
typename GUM_SCALAR,
template <
typename >
class ICPTGenerator >
78 template <
typename GUM_SCALAR,
template <
typename >
class ICPTGenerator >
88 template <
typename GUM_SCALAR,
template <
typename >
class ICPTGenerator >
90 BayesNet< GUM_SCALAR >& bayesNet) {
97 for (
Size j = i + 1; j < this->nbrNodes_; ++j)
101 while (this->
dag_.sizeArcs() < this->maxArcs_) {
105 if (i > j) std::swap(i, j);
107 if (!this->
dag_.existsArc(i, j)) this->
dag_.addArc(i, j);
void fromDAG(BayesNet< GUM_SCALAR > &bayesNet)
void fillCPT(BayesNet< GUM_SCALAR > &bn) const
IBayesNetGenerator(Size nbrNodes, Size maxArcs, Size maxModality)
SimpleBayesNetGenerator(Size nbrNodes, Size maxArcs, Size maxModality=2)
Constructor.
~SimpleBayesNetGenerator() override
Destructor.
void generateBN(BayesNet< GUM_SCALAR > &bayesNet) override
function that generates a Bayesian networks.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Idx randomValue(const Size max=2)
Returns a random Idx between 0 and max-1 included.
double randomProba()
Returns a random double between 0 and 1 included (i.e.
gum is the global namespace for all aGrUM entities
Class for generating Bayesian networks.
Contains useful methods for random stuff.