35 template <
typename GUM_SCALAR >
44 template <
typename GUM_SCALAR >
51 template <
typename GUM_SCALAR >
58 template <
typename GUM_SCALAR >
62 bool wrongValue =
false;
68 for (
const auto nod : this->
BN().topologicalOrder()) {
70 prev.
add(this->
BN().variable(nod));
72 auto localp = this->
BN().cpt(nod).get(prev);
WeightedSampling(const IBayesNet< GUM_SCALAR > *bn)
Default constructor.
~WeightedSampling() override
Destructor.
Instantiation & chgVal(const DiscreteVariable &v, Idx newval)
Assign newval to variable v in the Instantiation.
Class representing the minimal interface for Bayesian Network.
gum is the global namespace for all aGrUM entities
This file contains Weighted sampling class definition.
void clear()
Erase all variables from an Instantiation.
const NodeProperty< Idx > & hardEvidence() const
indicate for each node with hard evidence which value it took
const NodeSet & hardEvidenceNodes() const
returns the set of nodes with hard evidence
Class for assigning/browsing values to tuples of discrete variables.
Instantiation _draw(GUM_SCALAR *w, Instantiation prev) override
draws a sample according to Weighted sampling
void add(const DiscreteVariable &v) final
Adds a new variable in the Instantiation.
virtual void _addVarSample(NodeId nod, Instantiation *I)
adds a node to current instantiation
virtual const IBayesNet< GUM_SCALAR > & BN() const final
Returns a constant reference over the IBayesNet referenced by this class.
Instantiation _burnIn() override
draws a defined number of samples without updating the estimators