fixed some small issues regarding museum project
This commit is contained in:
@@ -160,7 +160,7 @@ namespace SMC {
|
||||
void updateTransitionOnly(const Control* control) {
|
||||
|
||||
// sanity checks (if enabled)
|
||||
Assert::isNotNull(transition, "transition MUST not be null! call setTransition() first!");
|
||||
Assert::isNotNull(transition, "transition MUST not be null! call setTransition() first!");
|
||||
|
||||
// perform the transition step
|
||||
transition->transition(particles, control);
|
||||
@@ -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;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "ParticleFilterResampling.h"
|
||||
#include "../../ParticleAssertions.h"
|
||||
#include "../../../Assertions.h"
|
||||
|
||||
int fuck_off = 0;
|
||||
|
||||
@@ -39,7 +40,7 @@ namespace SMC {
|
||||
|
||||
|
||||
void resample(std::vector<Particle<State>>& particles) override{
|
||||
|
||||
Assert::doThrow("lol, nothing happens here. Get out!");
|
||||
}
|
||||
|
||||
void resample(std::vector<Particle<State>>& particles, double kld, std::vector<Particle<State>>& particlesWifi) override {
|
||||
@@ -101,7 +102,7 @@ namespace SMC {
|
||||
Particle<State> posteriorParticle = draw(cumWeight);
|
||||
Particle<State> wifiParticle = drawWifi(cumWeightWifi);
|
||||
|
||||
posteriorParticle.state.position = wifiParticle.state.position;
|
||||
posteriorParticle.state.pos.pos = wifiParticle.state.pos.pos;
|
||||
particles[i] = posteriorParticle;
|
||||
} else {
|
||||
particles[i] = draw(cumWeight);
|
||||
|
||||
@@ -48,11 +48,11 @@ namespace SMC {
|
||||
public:
|
||||
|
||||
/** ctor */
|
||||
ParticleFilterResamplingKLD(double delta = 0.01, double epsilon = 0.13, uint32_t N_max = 25000) : delta(delta), epsilon(epsilon), N_max(N_max) {
|
||||
ParticleFilterResamplingKLD(double delta = 0.01, double epsilon = 0.13, uint32_t N_max = 10000) : delta(delta), epsilon(epsilon), N_max(N_max) {
|
||||
gen.seed(RANDOM_SEED);
|
||||
|
||||
bins.setBinSizes({0.01, 0.01, 0.2, 0.3});
|
||||
bins.setRanges({BinningRange(-1,100), BinningRange(-10,60), BinningRange(-1,15), BinningRange(0, 2 * M_PI)});
|
||||
bins.setBinSizes({0.01, 0.01, 0.2});
|
||||
bins.setRanges({BinningRange(-1,100), BinningRange(-10,60), BinningRange(-1,15)});
|
||||
}
|
||||
|
||||
void resample(std::vector<Particle<State>>& particles) override {
|
||||
|
||||
Reference in New Issue
Block a user