54#ifndef GUM_KTBN_GENERATOR_H
55#define GUM_KTBN_GENERATOR_H
113 template < GUM_Numeric GUM_SCALAR >
135 Size nbAtemporal = 0,
137 Size maxModality = 2);
189 const std::string& atemporal);
233 std::vector< _Arc_ >
_legalArcs_(
const std::vector< std::string >& temporal,
234 const std::vector< std::string >& atemporal,
235 const std::vector< Size >& tRank,
236 const std::vector< Size >& aRank)
const;
240 template <
typename T >
241 static void _shuffle_(std::vector< T >& v);
244#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Template implementation of gum::KTBNGenerator.
Class representing k-order dynamic Bayesian networks (k-DBN).
KTBNGenerator< GUM_SCALAR > & setMaxParents(Size maxParents)
Caps the number of parents of any node, which bounds CPT size. 0 (default) means unlimited — a dense ...
KTBN< GUM_SCALAR > generate()
Same, returning the model by value.
KTBNGenerator(Size k, Size nbTemporal, Size nbAtemporal=0, Size maxArcs=0, Size maxModality=2)
Constructor.
std::string _atemporalPrefix_
KTBNGenerator< GUM_SCALAR > & setGenerateCPTs(bool on)
Whether to fill the CPTs with random values (default true). When false only the structure is drawn an...
void generateKTBN(KTBN< GUM_SCALAR > &out)
Fills out with a freshly drawn model (its previous content is discarded). Seed it with gum::initRando...
static void _shuffle_(std::vector< T > &v)
Fisher-Yates through gum::randomValue, so gum::initRandom() alone makes a whole generation reproducib...
KTBNGenerator< GUM_SCALAR > & setDensity(double density)
Fraction of the legal arc set to draw, in . Ignored when a non-zero maxArcs was given to the construc...
KTBNGenerator< GUM_SCALAR > & setDomainRange(Size minModality, Size maxModality)
Domain sizes are drawn uniformly in .
std::string _temporalPrefix_
std::vector< _Arc_ > _legalArcs_(const std::vector< std::string > &temporal, const std::vector< std::string > &atemporal, const std::vector< Size > &tRank, const std::vector< Size > &aRank) const
Every arc the k-DBN's rules allow, with the two cycle-prone families (lag 0, atemporal→atemporal) alr...
KTBNGenerator< GUM_SCALAR > & setNamePrefixes(const std::string &temporal, const std::string &atemporal)
Name prefixes; variables are prefix0, prefix1, … Defaults are "X" (temporal) and "A" (atemporal).
KTBNGenerator< GUM_SCALAR > & setGuaranteeOrder(bool on)
Force one arc of lag into the kernel slice, so the model's effective order equals (see the class do...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
gum is the global namespace for all aGrUM entities
template class GUM_PUBLIC_KTBN KTBNGenerator< double >
A (tail, head) endpoint pair, each as (base, slice).
Contains useful methods for random stuff.