mixtureParticleFilter.cpp
Go to the documentation of this file.
1 // Copyright (C) 2009 Tinne De Laet <first dot last at gmail dot com>
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU Lesser General Public License as published by
5 // the Free Software Foundation; either version 2.1 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 //
17 // $Id: mixtureParticleFilter.cpp 2009-02-02 tdelaet $
18 
19 #include "mixtureParticleFilter.h"
20 #include "../pdf/mixture.h"
21 
22 #define SV StateVar
23 #define MV MeasVar
24 #define MeasModel MeasurementModel
25 
26 #define STATE_AND_MEAS_VAR_DIFFERENT
27 
28 template <typename SV, typename MV>
29 MixtureParticleFilter<SV,MV>::MixtureParticleFilter(Mixture<SV> * prior,
30  ConditionalPdf<SV,SV> * proposal,
31  int resampleperiod,
32  double resamplethreshold,
33  int resamplescheme,
34  int maintainMixturePeriod)
35  : Filter<SV,MV>(prior)
36  , _proposal(proposal)
37  , _sample(WeightedSample<SV>(prior->DimensionGet()))
38  , _resampleScheme(resamplescheme)
39  , _created_post(true)
40  , _newMixtureWeights(prior->NumComponentsGet())
41  , _sumWeights(prior->NumComponentsGet())
42  , _old_samplesVec(prior->NumComponentsGet())
43  , _new_samplesVec(prior->NumComponentsGet())
44  , _new_samples_unweightedVec(prior->NumComponentsGet())
45  , _maintainMixturePeriod(maintainMixturePeriod)
46 {
47  /* Initialize Post, at time = 0, post = prior
48  To be more clean, this should be done in the filter base class,
49  but this is impossible because of the pure virtuals...
50  */
51  // Post is equal to prior at timetep 1
52  this->_post = prior->Clone();
53 
54  // Initialise vector of lists of samples
55  for(int i = 0 ; i< dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet(); i++)
56  {
57  _old_samplesVec[i] = (dynamic_cast<MCPdf<SV> *>(prior->ComponentGet(i))->ListOfSamplesGet());
58  }
60 
61 
62 
63  // You have to choose for dynamic resampling by specifying a threshold != 0 OR give me a fixed resample period != 0
64  assert(!(resampleperiod == 0 && resamplethreshold == 0));
65  assert(!(resampleperiod != 0 && resamplethreshold != 0));
66 
67  // dynamic resampling
68  if (resampleperiod == 0)
69  _dynamicResampling = true;
70  // fixed period resampling
71  else
72  _dynamicResampling = false;
73  _resamplePeriod = resampleperiod;
74  _resampleThreshold = resamplethreshold;
75 }
76 
77 
78 
79 template <typename SV, typename MV>
81  Mixture<SV> * post,
82  ConditionalPdf<SV,SV> * proposal,
83  int resampleperiod,
84  double resamplethreshold,
85  int resamplescheme,
86  int maintainMixturePeriod)
87  : Filter<SV,MV>(prior)
88  , _proposal(proposal)
89  , _resampleScheme(resamplescheme)
90  , _created_post(false)
91  , _newMixtureWeights(prior->NumComponentsGet())
92  , _sumWeights(prior->NumComponentsGet())
93  , _old_samplesVec(prior->NumComponentsGet())
94  , _new_samplesVec(prior->NumComponentsGet())
95  , _new_samples_unweightedVec(prior->NumComponentsGet())
96  , _maintainMixturePeriod(maintainMixturePeriod)
97 {
98  this->_post = post;
99  // Post is equal to prior at timestep 1
100  /* Note: Dirty cast should be avoided by not demanding an MCPdf as
101  prior and just sample from the prior instead :-(
102  */
103  bool ret = (dynamic_cast<MCPdf<SV> *>(this->_post))->ListOfSamplesSet(prior->ListOfSamplesGet());
104  assert(ret);
105  for(int i =0 ; i < prior.NumComponentsGet() ; i++)
106  {
107  bool ret = (dynamic_cast<MCPdf<SV> *>(this->_post->ComponentGet(i)))->ListOfSamplesSet(prior->ComponentGet(i)->ListOfSamplesGet());
108  }
109 
110  // Initialise vector of lists of samples
111  for(int i =0 ; i < prior.NumComponentsGet() ; i++)
112  {
113  _old_samplesVec[i] = (prior.ComponentGet(i)->ListOfSamplesGet());
114  }
116 
117  // You have to choose for dynamic resampling by specifying a threshold != 0 OR give me a fixed resample period != 0
118  assert(!(resampleperiod == 0 && resamplethreshold == 0));
119  assert(!(resampleperiod != 0 && resamplethreshold != 0));
120 
121  // dynamic resampling
122  if (resampleperiod == 0)
123  _dynamicResampling = true;
124  // fixed period resampling
125  else
126  _dynamicResampling = false;
127 
128  _resamplePeriod = resampleperiod;
129  _resampleThreshold = resamplethreshold;
130 }
131 
132 
133 
134 
135 template <typename SV, typename MV>
137 {
138  if (_created_post)
139  delete this->_post;
140 }
141 
142 template <typename SV, typename MV>
144  : Filter<SV,MV>(filter)
145  , _created_post(true)
146 {
147  // Clone the Mixture posterior of filter
148  this->_post = filter.PostGet().Clone();
149  this->_newMixtureWeights.resize(this->_post->NumComponentsGet());
150  this->_sumWeights.resize(this->_post->NumComponentsGet());
151 }
152 
153 template <typename SV, typename MV> void
155 {
156  this->_prior = prior;
157  delete this->_post;
158  this->_post = prior->Clone();
159  this->_newMixtureWeights.resize(dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet());
160  this->_sumWeights.resize(dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet());
161 }
162 
163 template <typename SV, typename MV> void
165 {
166  _proposal = cpdf;
167 }
168 
169 template <typename SV, typename MV> ConditionalPdf<SV,SV> *
171 {
172  return _proposal;
173 }
174 
175 // Proposal step can be executed for each component in the mixture seperately
176 template <typename SV, typename MV> bool
178  const SV & u,
179  MeasurementModel<MV,SV> * const measmodel,
180  const MV & z,
181  const SV & s)
182 {
183  bool result = true;
184  for(int i = 0 ; i< dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet(); i++)
185  {
186  result = result && this->ProposalStepInternalOne(i,sysmodel,u,measmodel,z,s);
187  }
188  return result;
189 }
190 
191 // Proposal step for one component
192 template <typename SV, typename MV> bool
194  const SV & u,
195  MeasurementModel<MV,SV> * const measmodel,
196  const MV & z,
197  const SV & s)
198 {
199  // Get all samples from the current post through proposal density
200  _old_samplesVec[component]= (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesGet();
201 
202  _ns_it = _new_samplesVec[component].begin();
203  for ( _os_it=_old_samplesVec[component].begin(); _os_it != _old_samplesVec[component].end() ; _os_it++)
204  {
205  const SV& x_old = _os_it->ValueGet();
207 
208  if (!sysmodel->SystemWithoutInputs())
209  {
211  if (this->_proposal_depends_on_meas)
212  {
213  #ifndef STATE_AND_MEAS_VAR_DIFFERENT
215  if (!measmodel->SystemWithoutSensorParams())
217  #endif
218  }
219 
220  }
221  else // System without inputs
222  {
223  if (this->_proposal_depends_on_meas)
224  {
225  #ifndef STATE_AND_MEAS_VAR_DIFFERENT
227  if (!measmodel->SystemWithoutSensorParams())
229  #endif
230 
231  }
232  }
233  // Bug, make sampling method a parameter!
235  _ns_it->ValueSet(_sample.ValueGet());
236  _ns_it->WeightSet(_os_it->WeightGet());
237  _ns_it++;
238  }
239 
240  (this->_timestep)++;
241 
242  // Update the list of samples
243  return (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesUpdate(_new_samplesVec[component]);
244 
245 }
246 
247 template <typename SV, typename MV> bool
249  const SV & u,
250  MeasurementModel<MV,SV> * const measmodel,
251  const MV & z,
252  const SV & s)
253 {
254  // TODO: first calculate new weights of mixture components
255  bool result = true;
256  for(int i = 0 ; i< dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet(); i++)
257  {
258  this->UpdateWeightsInternalOne(i,sysmodel,u,measmodel,z,s);
259  }
260  for(int i = 0 ; i< dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet(); i++)
261  {
262  // calculate the new unnormalized mixture weights:
263  // new_weight = old_weight * _sumWeights[i]
264  // _sumWeights[i] is the sum of the particle weights of the i'th component
265  // MPCdf and is an approximation of the i-th component likelihood
266  _newMixtureWeights[i] = dynamic_cast<Mixture<SV> *>(this->_post)->WeightGet(i) * _sumWeights[i];
267  }
268  // Update the mixture weights
269  result = result && dynamic_cast<Mixture<SV> * >(this->_post)->WeightsSet(_newMixtureWeights); // this function automatically takes care of normalization
270 
271  return result;
272 }
273 
274 template <typename SV, typename MV> bool
276  const SV & u,
277  MeasurementModel<MV,SV> * const measmodel,
278  const MV & z,
279  const SV & s)
280 {
281  if(component < 0 || component > dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet())
282  {
283  cerr<< "MixtureParticleFilter::UpdateWeightsInternalOne called with invalid component number " << endl;
284  return false;
285  }
286  _sumWeights[component] = 0.0;
287  Probability weightfactor = 1;
288  // Update the weights
289  // Same remarks as for the system update!
290  _new_samplesVec[component] = (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesGet();
291  _os_it = _old_samplesVec[component].begin();
292 
293  for ( _ns_it=_new_samplesVec[component].begin(); _ns_it != _new_samplesVec[component].end() ; _ns_it++)
294  {
295  const SV& x_new = _ns_it->ValueGet();
296  const SV& x_old = _os_it->ValueGet();
297 
298  if (sysmodel == NULL)
299  {
300  if (measmodel->SystemWithoutSensorParams() == true)
301  {
302  weightfactor = measmodel->ProbabilityGet(z,x_new);
303  }
304  else
305  weightfactor = measmodel->ProbabilityGet(z,x_new,s);
306  }
307  else // We do have a system model
308  {
310  if (measmodel->SystemWithoutSensorParams() == true)
311  {
312  weightfactor = measmodel->ProbabilityGet(z,x_new);
313  if (sysmodel->SystemWithoutInputs() == false)
314  {
316  if (this->_proposal_depends_on_meas){
317  #ifndef STATE_AND_MEAS_VAR_DIFFERENT
319  #endif
320  }
321 
322  if (_proposal->ProbabilityGet(x_new) != 0)
323  weightfactor = weightfactor * ( sysmodel->ProbabilityGet(x_new,x_old,u) / _proposal->ProbabilityGet(x_new) );
324  else weightfactor = 0;
325  }
326  else // we do have a system without inputs
327  {
328  if (this->_proposal_depends_on_meas){
329  #ifndef STATE_AND_MEAS_VAR_DIFFERENT
331  #endif
332  }
333  if ( _proposal->ProbabilityGet(x_new) != 0)
334  weightfactor = weightfactor * ( sysmodel->ProbabilityGet(x_new,_os_it->ValueGet()) / _proposal->ProbabilityGet(x_new) );
335  else weightfactor = 0;
336  }
337  }
338  else // System with sensor Parameters
339  {
340  weightfactor = measmodel->ProbabilityGet(z,x_new,s);
341  }
342  }
343  double new_weight = _ns_it->WeightGet() * weightfactor;
344  _ns_it->WeightSet(new_weight);
345  // add the new weight to the _sumWeights of this component
346  _sumWeights[component] = _sumWeights[component] + new_weight;
347 
348  _os_it++;
349  }
350  // Update the sample list of post the SumofWeights of the pdf
351  // Update the mixture PDfs
352  return (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesUpdate(_new_samplesVec[component]);
353 }
354 
355 template <typename SV, typename MV> bool
357 {
358  bool result = true;
359  // Independent resampling for different components
360  for(int i = 0 ; i< dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet(); i++)
361  {
362  result = result && this->DynamicResampleStepOne(i);
363  }
364  return result;
365 }
366 
367 template <typename SV, typename MV> bool
369 {
370  // Resampling?
371  bool resampling = false;
372  double sum_sq_weigths = 0.0;
373 
374  // Resampling if necessary
375  if ( this->_dynamicResampling)
376  {
377  // Check if sum of 1 / \sum{(wi_normalised)^2} < threshold
378  // This is the criterion proposed by Liu
379  // BUG foresee other methods of approximation/calculating
380  // effective sample size. Let the user implement this in !
381  _new_samplesVec[component] = (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesGet();
382  for ( _ns_it=_new_samplesVec[component].begin(); _ns_it != _new_samplesVec[component].end() ; _ns_it++)
383  {
384  sum_sq_weigths += pow(_ns_it->WeightGet(),2);
385  }
386  if ((1.0 / sum_sq_weigths) < _resampleThreshold)
387  {
388  // #define __RESAMPLE_DEBUG__
389 #ifdef __RESAMPLE_DEBUG__
390  cout << "resampling now: " << this->_timestep
391  << "\tN_eff: " << (1.0 / sum_sq_weigths) << endl;
392 #endif // __RESAMPLE_DEBUG__
393  resampling = true;
394  }
395  }
396  if (resampling == true)
397  return this->ResampleOne(component);
398  else
399  return true;
400 }
401 
402 
403 template <typename SV, typename MV> bool
405 {
406  // Resampling if necessary
407  if ( (!this->_dynamicResampling) && (((this->_timestep) % _resamplePeriod) == 0) && (this->_timestep != 0))
408  return this->Resample();
409  return true;
410 }
411 
412 
413 template <typename SV, typename MV> bool
415  const StateVar& u,
416  MeasurementModel<MeasVar,StateVar>* const measmodel,
417  const MeasVar& z,
418  const StateVar& s)
419 {
420  bool result = true;
421 
422  // Only makes sense if there is a system model?
423  // Bug, not completely true, but should do for now...
424  if (sysmodel != NULL)
425  {
426  result = result && this->StaticResampleStep();
427  result = result && this->ProposalStepInternal(sysmodel,u,measmodel,z,s);
428 
429  }
430  // Updating the weights only makes sense using a measurement model
431  if (measmodel != NULL)
432  {
433  result = result && this->UpdateWeightsInternal(sysmodel,u,measmodel,z,s);
434  result = result && this->DynamicResampleStep();
435  }
436 
437  // Mixture Computation: recompute mixture representation to take into account
438  // possibly varying number of modes.
439  result = result && this->MaintainMixture();
440 
441  return result;
442 }
443 
444 template <typename SV, typename MV> bool
446 {
447  bool result = true;
448  // Independent resampling for different components
449  for(int i = 0 ; i< dynamic_cast<Mixture<SV> *>(this->_post)->NumComponentsGet(); i++)
450  {
451  result = result && this->ResampleOne(i);
452  }
453  return result;
454 }
455 
456 template <typename SV, typename MV> bool
458 {
459  int NumSamples = (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->NumSamplesGet();
460  // #define __MixtureParticleFilter_DEBUG__
461 #ifdef __MixtureParticleFilter_DEBUG__
462  cout << "MixtureParticleFilter: resampling now" << endl;
463  _new_samplesVec[component]= (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesGet();
464  for ( _ns_it=_new_samplesVec[component].begin(); _ns_it != _new_samplesVec[component].end() ; _ns_it++)
465  {
466  cout << "PF: Old samples:\n";
467  cout << _ns_it->ValueGet() << _ns_it->WeightGet() << endl;
468  }
469 #endif // __MixtureParticleFilter_DEBUG
470  switch(_resampleScheme)
471  {
472  case MULTINOMIAL_RS:
473  {
474  (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->SampleFrom(_new_samples_unweightedVec[component], NumSamples,RIPLEY,NULL);
475  break;
476  }
477  case SYSTEMATIC_RS:{break;}
478  case STRATIFIED_RS:{break;}
479  case RESIDUAL_RS:{break;}
480  default:
481  {
482  cerr << "Sampling method not supported" << endl;
483  break;
484  }
485  }
486  bool result = (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesUpdate(_new_samples_unweightedVec[component]);
487 #ifdef __MixtureParticleFilter_DEBUG__
488  cout << "MixtureParticleFilter: after resampling" << endl;
489  _new_samplesVec[component]= (dynamic_cast<MCPdf<SV> *>(dynamic_cast<Mixture<SV> *>(this->_post)->ComponentGet(component)))->ListOfSamplesGet();
490  for ( _ns_it=_new_samplesVec[component].begin(); _ns_it != _new_samplesVec[component].end() ; _ns_it++)
491  {
492  cout << "PF: New samples:\n";
493  cout << _ns_it->ValueGet() << _ns_it->WeightGet() << endl;
494  }
495 #endif // __MixtureParticleFilter_DEBUG
496 
497  return result;
498 }
499 
500 
501 template<typename SV, typename MV> Mixture<SV> *
503 {
505 }
506 
507 template <typename SV, typename MV> bool
509 {
510  // Resampling if necessary
511  if ( (((this->_timestep) % _maintainMixturePeriod) == 0) && (this->_timestep != 0))
512  return this->MaintainMixture();
513  return true;
514 }
515 
516 template <typename SV, typename MV> bool
518 {
519  // Default method doesn't take care of Mixture Maintainance
520  return true;
521 }
virtual ~MixtureParticleFilter()
Destructor.
#define STRATIFIED_RS
#define RESIDUAL_RS
Abstract class representing an interface for Bayesian Filters.
Definition: filter.h:77
#define SV
vector< vector< WeightedSample< StateVar > > > _new_samplesVec
While updating store list of new samples.
Virtual Class representing all Mixture particle filters.
#define MULTINOMIAL_RS
#define MV
double _resampleThreshold
Threshold used when dynamic resampling.
virtual bool ProposalStepInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Proposal step.
vector< WeightedSample< StateVar > >::iterator _os_it
Iterator for old list of samples.
#define DEFAULT
ConditionalPdf< StateVar, StateVar > * _proposal
Pointer to the Proposal Density.
virtual void Reset(Mixture< StateVar > *prior)
Reset Filter.
int _resampleScheme
Which resample algorithm (see top of particle.h for #defines)
int _maintainMixturePeriod
Number of timestep between mixture maintainance of the Posterior.
virtual bool UpdateInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Actual implementation of Update, varies along filters.
WeightedSample< StateVar > _sample
While updating use sample<StateVar>
vector< vector< Sample< StateVar > > > _new_samples_unweightedVec
While resampling.
virtual Mixture< StateVar > * PostGet()
Get Posterior density.
Filter(Pdf< StateVar > *prior)
Constructor.
Definition: filter.h:27
ConditionalPdf< StateVar, StateVar > * ProposalGet()
Get a pointer to the proposal density.
bool SystemWithoutSensorParams() const
Number of Conditional Arguments.
Pdf< StateVar > * _post
Pointer to the Posterior Pdf.
Definition: filter.h:95
MixtureParticleFilter(Mixture< StateVar > *prior, ConditionalPdf< StateVar, StateVar > *proposal, int resampleperiod=0, double resamplethreshold=0, int resamplescheme=DEFAULT_RS, int maintainMixturePeriod=1)
Constructor.
virtual bool UpdateWeightsInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Update Weights.
bool SystemWithoutInputs() const
Has the system inputs or not.
Definition: systemmodel.cpp:84
virtual void ConditionalArgumentSet(unsigned int n_argument, const CondArg &argument)
Set the n-th argument of the list.
#define StateVar
Definition: asirfilter.h:22
vector< WeightedSample< StateVar > >::iterator _ns_it
Iterator for new list of samples.
virtual bool Resample()
Actual Resampling happens here;.
virtual Pdf< StateVar > * PostGet()
Get Posterior density.
Definition: filter.cpp:126
Probability ProbabilityGet(const MeasVar &z, const StateVar &x, const StateVar &s)
Get the probability of a certain measurement.
virtual Probability ProbabilityGet(const T &input) const
Get the probability of a certain argument.
virtual bool MaintainMixture()
Actual mixture maintainance happens here;.
virtual void ProposalSet(ConditionalPdf< StateVar, StateVar > *const cpdf)
Set the proposal density.
virtual bool ResampleOne(int component)
Actual Resampling for one component;.
Abstract Class representing conditional Pdfs P(x | ...)
Class representing a mixture of PDFs, the mixture can contain different.
Definition: mixture.h:48
int _timestep
Represents the current timestep of the filter.
Definition: filter.h:100
#define SYSTEMATIC_RS
Monte Carlo Pdf: Sample based implementation of Pdf.
Definition: mcpdf.h:49
virtual bool UpdateWeightsInternalOne(int component, SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Update Weights for one component.
virtual bool MaintainMixtureStep()
Maintain Mixture if wanted.
#define RIPLEY
virtual bool ProposalStepInternalOne(int component, SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Proposal step for one component.
virtual bool SampleFrom(vector< Sample< T > > &list_samples, const unsigned int num_samples, int method=DEFAULT, void *args=NULL) const
Draw multiple samples from the Pdf (overloaded)
#define MeasVar
Definition: asirfilter.h:23
virtual bool DynamicResampleStepOne(int component)
Resampling for one component.
Probability ProbabilityGet(const T &x_k, const T &x_kminusone, const T &u)
Get the probability of arriving in a next state.
virtual bool DynamicResampleStep()
Resample if necessary.
virtual bool StaticResampleStep()
Resample if wanted.
bool _proposal_depends_on_meas
Proposal depends on last measurement?
vector< Probability > _newMixtureWeights
Vector containing the new mixture weights during update step.
Class representing a probability (a double between 0 and 1)
Definition: bfl_constants.h:39
vector< Probability > _sumWeights
Vector containing the sum of weights during update step.
Pdf< T > * ComponentGet(unsigned int componentNumber) const
Get the pointer to the component pdf of component "componentNumber".
Pdf< StateVar > * _prior
prior Pdf
Definition: filter.h:82
vector< vector< WeightedSample< StateVar > > > _old_samplesVec
While updating store list of old samples.
virtual Pdf< T > * Clone() const =0
Pure virtual clone function.
int _resamplePeriod
Number of timestep between resampling from the Posterior Pdf.
bool _created_post
created own post
T & ValueGet()
Get the value of the Sample.
Definition: asirfilter.h:132
bool _dynamicResampling
Dynamic resampling or fixed period resampling?
virtual Mixture * Clone() const
Clone function.


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Mon Jun 10 2019 12:47:59