We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c433b8 commit c796361Copy full SHA for c796361
src/core/belief.cpp
@@ -383,8 +383,16 @@ void ParticleBelief::Update(int action, OBS_TYPE obs) {
383
for (int i = 0; i < initial_particles_.size(); i ++)
384
particles_.push_back(model_->Copy(initial_particles_[i]));
385
}
386
+
387
+ //Update total weight so that effective number of particles are computed correctly
388
+ total_weight = 0;
389
+ for (int i = 0; i < particles_.size(); i++) {
390
+ State* particle = particles_[i];
391
+ total_weight = total_weight + particle->weight;
392
+ }
393
394
395
396
double weight_square_sum = 0;
397
for (int i = 0; i < particles_.size(); i++) {
398
State* particle = particles_[i];
0 commit comments