38 template <
typename GUM_SCALAR >
47 template <
typename GUM_SCALAR >
54 template <
typename GUM_SCALAR >
61 template <
typename GUM_SCALAR >
65 bool wrongValue =
false;
71 for (
const auto nod : this->
BN().topologicalOrder()) {
73 prev.
add(this->
BN().variable(nod));
75 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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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