Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ParticleFilter< ParticleT >::DistributionPolicy Class Reference

A distribution policy provides the ability to randomize ("redistribute") or tweak the values of a group of particles. More...

#include <ParticleFilter.h>

Inheritance diagram for ParticleFilter< ParticleT >::DistributionPolicy:

Detailed Description

template<typename ParticleT>
class ParticleFilter< ParticleT >::DistributionPolicy

A distribution policy provides the ability to randomize ("redistribute") or tweak the values of a group of particles.

Unlike the other particle filter helper classes, the functions for the distribution policy operate on a subset of the particles at a time. You may wonder why the randomize() and jiggle() functions aren't simply made methods of the ParticleBase class. The main reason is that these functions may need additional parameters, such as specification of how large an area to distribute over, and these parameters are static across particles. However, if they were actually static members of the particle class, then the values would be shared by all particle filters. By making a separate class to hold the parameters and apply the one-to-many relationship, you can have multiple particle filters with the same type of particle, and each filter can have different parameter values controlling distribution of its particles.

Note that the DistributionPolicy is actually a property of the resampling policy, not directly of the particle filter itself.

Definition at line 182 of file ParticleFilter.h.

List of all members.

Public Types

typedef ParticleT particle_type
 redefinition here allows reference to the particle type even if the template parameter may be abstracted away due to a typedef
typedef std::vector
< particle_type
particle_collection
 the collection type we'll be using to store the particles
typedef
particle_collection::size_type 
index_t
 index type for refering to particles within the collection

Public Member Functions

virtual ~DistributionPolicy ()
 destructor
virtual void randomize (particle_type *begin, index_t num)=0
 This should redistribute the particles over a large area, independently of the particle's current value.
virtual void jiggle (float var, particle_type *begin, index_t num)=0
 This should slightly modify the particles' state values.

Member Typedef Documentation

template<typename ParticleT>
typedef particle_collection::size_type ParticleFilter< ParticleT >::DistributionPolicy::index_t

index type for refering to particles within the collection

Reimplemented in LocalizationParticleDistributionPolicy< ParticleT >, and DualCoding::ShapeParticleDistributionPolicy< ParticleT >.

Definition at line 186 of file ParticleFilter.h.

template<typename ParticleT>
typedef std::vector<particle_type> ParticleFilter< ParticleT >::DistributionPolicy::particle_collection

the collection type we'll be using to store the particles

Definition at line 185 of file ParticleFilter.h.

template<typename ParticleT>
typedef ParticleT ParticleFilter< ParticleT >::DistributionPolicy::particle_type

redefinition here allows reference to the particle type even if the template parameter may be abstracted away due to a typedef

Reimplemented in LocalizationParticleDistributionPolicy< ParticleT >, and DualCoding::ShapeParticleDistributionPolicy< ParticleT >.

Definition at line 184 of file ParticleFilter.h.


Constructor & Destructor Documentation

template<typename ParticleT>
virtual ParticleFilter< ParticleT >::DistributionPolicy::~DistributionPolicy (  )  [virtual]

destructor

Definition at line 187 of file ParticleFilter.h.


Member Function Documentation

template<typename ParticleT>
virtual void ParticleFilter< ParticleT >::DistributionPolicy::jiggle ( float  var,
particle_type begin,
index_t  num 
) [pure virtual]

This should slightly modify the particles' state values.

Parameters:
var indicates the scale of the variance desired -- multiply whatever variance you use for modifying each state parameter by this value
begin the first particle in the array
num the number of particles to apply the operation to

This function is called on particles which have been replicated from an existing particle to explore the space around that particle. The more accurate your sensors and particle evaluation, the smaller the jiggle variance can be.

Referenced by ParticleFilter< ParticleT >::LowVarianceResamplingPolicy::resample(), and ParticleFilter< LocalizationParticle >::setPosition().

template<typename ParticleT>
virtual void ParticleFilter< ParticleT >::DistributionPolicy::randomize ( particle_type begin,
index_t  num 
) [pure virtual]

This should redistribute the particles over a large area, independently of the particle's current value.

Randomization occurs whenever the particle filter doesn't have any usable particles for replication, either because the particle filter has just been created and doesn't have any information yet, or because new sensor readings have invalidated all of the current particles.

Referenced by ParticleFilter< ParticleT >::LowVarianceResamplingPolicy::resample(), ParticleFilter< LocalizationParticle >::resetFilter(), and ParticleFilter< LocalizationParticle >::resizeParticles().


The documentation for this class was generated from the following file:

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:14 2016 by Doxygen 1.6.3