indii/ml/filter/ParticleFilterModel.hpp

00001 #ifndef INDII_ML_FILTER_PARTICLEFILTERMODEL_HPP
00002 #define INDII_ML_FILTER_PARTICLEFILTERMODEL_HPP
00003 
00004 #include "../aux/vector.hpp"
00005 
00006 namespace indii {
00007   namespace ml {
00008     namespace filter {
00009 
00010 /**
00011  * ParticleFilter compatible model.
00012  *
00013  * @author Lawrence Murray <lawrence@indii.org>
00014  * @version $Rev: 544 $
00015  * @date $Date: 2008-09-01 15:04:39 +0100 (Mon, 01 Sep 2008) $
00016  *
00017  * @param T The type of time.
00018  * 
00019  * @see indii::ml::filter for general usage guidelines.
00020  */
00021 template <class T = unsigned int>
00022 class ParticleFilterModel {
00023 public:
00024   /**
00025    * Destructor.
00026    */
00027   virtual ~ParticleFilterModel() = 0;
00028 
00029   /**
00030    * Get number of dimensions in state.
00031    *
00032    * @return Number of dimensions in state.
00033    */
00034   virtual unsigned int getStateSize() = 0;
00035 
00036   /**
00037    * Get number of dimensions in measurements.
00038    *
00039    * @return Number of dimensions in measurements.
00040    */
00041   virtual unsigned int getMeasurementSize() = 0;
00042 
00043   /**
00044    * Propagate particle through the state transition function.
00045    *
00046    * @param s \f$\mathbf{s}\f$; a particle.
00047    * @param t \f$t\f$; start time. This is provided to allow the
00048    * calculation of deterministic input functions.
00049    * @param delta \f$\Delta t\f$; time step.
00050    *
00051    * @return \f$f(\mathbf{s}, \mathbf{w}, \Delta t)\f$; propagation of
00052    * the particle through the transition function, with noise.
00053    */
00054   virtual indii::ml::aux::vector transition(const indii::ml::aux::vector& s,
00055       const T t, const T delta) = 0;
00056 
00057   /**
00058    * Apply the measurement function to an individual particle.
00059    *
00060    * @param s \f$\mathbf{s}\f$; a particle.
00061    *
00062    * @return \f$g(\mathbf{s},\mathbf{v})\f$; predicted measurement
00063    * from the particle, with noise.
00064    */
00065   virtual indii::ml::aux::vector measure(const indii::ml::aux::vector& s) = 0;
00066 
00067   /**
00068    * Weight particle with measurement. The distribution over predicted
00069    * measurements from the given particle is calculated. The density
00070    * of this distribution at the actual measurement given becomes the
00071    * weight assigned to the particle.
00072    *
00073    * @param s \f$\mathbf{s}\f$; a particle.
00074    * @param y \f$\mathbf{y}\f$; the actual measurement.
00075    *
00076    * @return Weight assigned to the particle.
00077    */
00078   virtual double weight(const indii::ml::aux::vector& s,
00079       const indii::ml::aux::vector& y) = 0;
00080 
00081 };
00082 
00083     }
00084   }
00085 }
00086 
00087 template <class T>
00088 indii::ml::filter::ParticleFilterModel<T>::~ParticleFilterModel() {
00089   //
00090 }
00091 
00092 #endif
00093 

Generated on Wed Dec 17 15:11:57 2008 for dysii Dynamical Systems Library by  doxygen 1.5.3