stuff dont know git...

This commit is contained in:
toni
2018-02-12 17:00:42 +01:00
parent 632b1ca7a7
commit 77ffb76252
2 changed files with 9 additions and 5 deletions

View File

@@ -171,9 +171,9 @@ namespace SMC {
State updateEvaluationOnly(const Observation& observation) {
// sanity checks (if enabled)
Assert::isNotNull(resampler, "resampler MUST not be null! call setResampler() first!");
Assert::isNotNull(resampler, "resampler MUST not be null! call setResampler() first!");
Assert::isNotNull(evaluation, "evaluation MUST not be null! call setEvaluation() first!");
Assert::isNotNull(estimation, "estimation MUST not be null! call setEstimation() first!");
Assert::isNotNull(estimation, "estimation MUST not be null! call setEstimation() first!");
// perform the evaluation step and calculate the sum of all particle weights
evaluation->evaluation(particles, observation);
@@ -184,13 +184,13 @@ namespace SMC {
//Assert::isNotNull(weightSum, "sum of all particle weights (returned from eval) is 0.0!");
// normalize the particle weights and thereby calculate N_eff
const double neff = normalize();
const double neff = normalize();
// estimate the current state
const State est = estimation->estimate(particles);
// if the number of efficient particles is too low, perform resampling
if (neff < particles.size() * nEffThresholdPercent) { resampler->resample(particles); }
// if the number of efficient particles is too low, perform resampling
if (neff < particles.size() * nEffThresholdPercent) { resampler->resample(particles); }
// done
return est;