Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ParticleFilter< ParticleT >::ResamplingPolicy Class Reference

#include <ParticleFilter.h>

Inheritance diagram for ParticleFilter< ParticleT >::ResamplingPolicy:

List of all members.


Detailed Description

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

The resampling policy focuses the particle filter on those particles which are performing well, and dropping those which are poorly rated.

Resampling should replicate particles proportionally to how well their weights compare to other particles in the filter. The process is similar to a genetic algorithm. This process typically does not vary between applications, so you will probably want to use the supplied LowVarianceResamplingPolicy, and simply tweak parameters as needed.

The ResamplingPolicy interface includes a DistributionPolicy so particles can be randomly generated or modified in an abstract manner.

Definition at line 218 of file ParticleFilter.h.


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

 ResamplingPolicy ()
 constructor, creates a DistributionPolicy based on the particle_type's own DistributionPolicy typedef
 ResamplingPolicy (DistributionPolicy *distPolicy)
 constructor, pass your own custom distribution policy (responsibility for deallocation is assumed by the ResamplingPolicy)
virtual ~ResamplingPolicy ()
 destructor
virtual void resample (particle_collection &particles, index_t &bestIndex)=0
 the particle filter will call resample() when the particles have been evaluated and are ready to be selected
virtual void setDistributionPolicy (DistributionPolicy *distPolicy)
 replaces dist with a new distribution policy. If you pass NULL, dist will be reset to the particle_type's default distribution policy, as specified by a 'DistributionPolicy' typedef within the particle class
virtual DistributionPolicygetDistributionPolicy () const
 returns the currently active distribution policy (dist)

Protected Attributes

DistributionPolicydist
 a pointer to the current distribution policy, which cannot be NULL

Private Member Functions

 ResamplingPolicy (const ResamplingPolicy &rp)
 copy unsupported
ResamplingPolicyoperator= (const ResamplingPolicy &rp)
 assignment unsupported

Member Typedef Documentation

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

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

Definition at line 220 of file ParticleFilter.h.

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

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

Definition at line 221 of file ParticleFilter.h.

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

index type for refering to particles within the collection

Definition at line 222 of file ParticleFilter.h.


Constructor & Destructor Documentation

template<typename ParticleT>
ParticleFilter< ParticleT >::ResamplingPolicy::ResamplingPolicy (  )  [inline]

constructor, creates a DistributionPolicy based on the particle_type's own DistributionPolicy typedef

Definition at line 225 of file ParticleFilter.h.

template<typename ParticleT>
ParticleFilter< ParticleT >::ResamplingPolicy::ResamplingPolicy ( DistributionPolicy distPolicy  )  [inline, explicit]

constructor, pass your own custom distribution policy (responsibility for deallocation is assumed by the ResamplingPolicy)

Definition at line 227 of file ParticleFilter.h.

template<typename ParticleT>
virtual ParticleFilter< ParticleT >::ResamplingPolicy::~ResamplingPolicy (  )  [inline, virtual]

destructor

Definition at line 229 of file ParticleFilter.h.

template<typename ParticleT>
ParticleFilter< ParticleT >::ResamplingPolicy::ResamplingPolicy ( const ResamplingPolicy rp  )  [private]

copy unsupported


Member Function Documentation

template<typename ParticleT>
virtual void ParticleFilter< ParticleT >::ResamplingPolicy::resample ( particle_collection particles,
index_t bestIndex 
) [pure virtual]

the particle filter will call resample() when the particles have been evaluated and are ready to be selected

Implemented in ParticleFilter< ParticleT >::LowVarianceResamplingPolicy.

Referenced by ParticleFilter< ParticleT >::resample().

template<typename ParticleT>
virtual void ParticleFilter< ParticleT >::ResamplingPolicy::setDistributionPolicy ( DistributionPolicy distPolicy  )  [inline, virtual]

replaces dist with a new distribution policy. If you pass NULL, dist will be reset to the particle_type's default distribution policy, as specified by a 'DistributionPolicy' typedef within the particle class

Definition at line 233 of file ParticleFilter.h.

template<typename ParticleT>
virtual DistributionPolicy& ParticleFilter< ParticleT >::ResamplingPolicy::getDistributionPolicy (  )  const [inline, virtual]

returns the currently active distribution policy (dist)

Definition at line 238 of file ParticleFilter.h.

Referenced by ParticleFilter< ParticleT >::resetFilter(), ParticleFilter< ParticleT >::resizeParticles(), and ParticleFilter< ParticleT >::setPosition().

template<typename ParticleT>
ResamplingPolicy& ParticleFilter< ParticleT >::ResamplingPolicy::operator= ( const ResamplingPolicy rp  )  [private]

assignment unsupported


Member Data Documentation


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

Tekkotsu v4.0
Generated Thu Nov 22 00:58:35 2007 by Doxygen 1.5.4