Skip to content

Commit

Permalink
Fix particle swaping out of the fuse target loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilherme Lawless committed Jan 16, 2017
1 parent 757a852 commit 15a77d1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pfuclt_particles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,19 +440,19 @@ void ParticleFilter::fuseTarget()
mStar = p;
}
}
}

// Particle m* has been found, let's swap the subparticles
for (uint i = 0; i < STATES_PER_TARGET; ++i)
std::swap(particles_[O_TARGET + i][m], particles_[O_TARGET + i][mStar]);
// Particle m* has been found, let's swap the subparticles
for (uint i = 0; i < STATES_PER_TARGET; ++i)
std::swap(particles_[O_TARGET + i][m], particles_[O_TARGET + i][mStar]);

// Update the weight of this particle
particles_[O_WEIGHT][m] *= maxTargetSubParticleWeight;
// Update the weight of this particle
particles_[O_WEIGHT][m] *= maxTargetSubParticleWeight;

// The target subparticles are now reordered according to their weight
// contribution
// The target subparticles are now reordered according to their weight
// contribution

// printWeights("After fuseTarget(): ");
// printWeights("After fuseTarget(): ");
}
}

void ParticleFilter::modifiedMultinomialResampler(uint startAt)
Expand Down

0 comments on commit 15a77d1

Please sign in to comment.