Skip to content

Commit f40e1a4

Browse files
jbrodovskyCopilot
andauthored
Update core/src/particle.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5a33370 commit f40e1a4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

core/src/particle.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ impl<P: Particle> BasicParticleFilter<P> {
675675
///
676676
/// This method now wraps the generic resampling functions provided
677677
/// by this module.
678+
///
679+
/// Note: Weights should be normalized before resampling so that they
680+
/// sum to 1.0. Call [`Self::normalize_weights`] first if needed.
678681
pub fn resample(&mut self) {
679682
let num_particles = self.particles.len();
680683
let weights: Vec<f64> = self.particles.iter().map(|p| p.weight()).collect();

0 commit comments

Comments
 (0)