58 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
75 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
81 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
83 for (
auto node: bn.nodes())
84 this->generateCPT(bn.cpt(node).pos(bn.variable(node)), bn.cpt(node));
87 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
92 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
97 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
102 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
110 template <
GUM_Numeric GUM_SCALAR, template < typename > class ICPTGenerator >
118 template < GUM_Numeric GUM_SCALAR,
template <
typename >
class ICPTGenerator >
126 template <
GUM_Numeric GUM_SCALAR, template < typename > class ICPTGenerator >
130 const auto width = (this->
dag_.size() >= 100) ? 3 : 2;
132 const auto& topo = this->
dag_.topologicalOrder();
133 for (
const auto node: topo) {
140 bn.beginTopologyTransformation();
141 for (
auto arc: this->dag_.arcs()) {
142 bn.addArc(arc.tail(), arc.head());
144 bn.endTopologyTransformation();
Interface-like class for generating Bayesian networks.
Class representing a Bayesian network.
void setNbrNodes(Size nbrNodes)
Modifies the value of the number of nodes imposed on the BayesGenerator.
Size nbrNodes() const
Return a constant reference to the number of nodes imposed on the IBayesNetGenerator.
void fromDAG(BayesNet< GUM_SCALAR > &bayesNet)
Virtual function that Generates a Bayesian networks.
void setMaxModality(Size maxModality)
Modifies the value of the number of nodes imposed on the BayesGenerator.
void fillCPT(BayesNet< GUM_SCALAR > &bn) const
function that insert random values in the CPT of each nodes according to the CPTGenerator.
~IBayesNetGenerator() override
Destructor.
Size maxArcs() const
Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator.
void setMaxArcs(Size maxArcs)
Modifies the value of the number of nodes imposed on the BayesGenerator.
Size maxModality() const
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator.
IBayesNetGenerator(Size nbrNodes, Size maxArcs, Size maxModality)
constructor.
Exception : operation not allowed.
Defines a discrete random variable over an integer interval.
Complete concept for GUM_SCALAR template parameter.
#define GUM_ERROR(type, msg)
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.
gum is the global namespace for all aGrUM entities
Header of gumRangeVariable.