57 template <
typename GUM_SCALAR >
64 template <
typename GUM_SCALAR >
70 template <
typename GUM_SCALAR >
76 template <
typename GUM_SCALAR >
79 bool wrongValue =
false;
85 for (
const auto nod: this->
BN().topologicalOrder()) {
87 prev.
add(this->
BN().variable(nod));
89 auto localp = this->
BN().cpt(nod).get(prev);
101 }
while (wrongValue);
virtual const IBayesNet< GUM_SCALAR > & BN() const final
Returns a constant reference over the IBayesNet referenced by this class.
const NodeSet & hardEvidenceNodes() const
returns the set of nodes with hard evidence
const NodeProperty< Idx > & hardEvidence() const
indicate for each node with hard evidence which value it took
Class representing the minimal interface for Bayesian network with no numerical data.
Class for assigning/browsing values to tuples of discrete variables.
Instantiation & chgVal(const DiscreteVariable &v, Idx newval)
Assign newval to variable v in the Instantiation.
void clear()
Erase all variables from an Instantiation.
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
SamplingInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor
WeightedSampling(const IBayesNet< GUM_SCALAR > *bn)
Default constructor.
Instantiation draw_(GUM_SCALAR *w, Instantiation prev) override
draws a sample according to Weighted sampling
Instantiation burnIn_() override
draws a defined number of samples without updating the estimators
~WeightedSampling() override
Destructor.
gum is the global namespace for all aGrUM entities
This file contains Weighted sampling class definition.