00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "mixtureBootstrapFilter.h"
00020 #include "../sample/weightedsample.h"
00021
00022 #define StateVar SVar
00023 #define MeasVar MVar
00024
00025 template <typename SVar, typename MVar>
00026 MixtureBootstrapFilter<SVar,MVar>::MixtureBootstrapFilter(Mixture<SVar> * prior,
00027 int resampleperiod,
00028 double resamplethreshold,
00029 int resamplescheme,
00030 int maintainMixturePeriod)
00031 : MixtureParticleFilter<SVar,MVar>(prior,NULL,resampleperiod,
00032 resamplethreshold,
00033 resamplescheme,
00034 maintainMixturePeriod)
00035 {
00036
00037
00038 this->_proposal_depends_on_meas = false;
00039 }
00040
00041
00042 template <typename SVar, typename MVar>
00043 MixtureBootstrapFilter<SVar,MVar>::MixtureBootstrapFilter(Mixture<SVar> * prior,
00044 Mixture<SVar> * post,
00045 int resampleperiod,
00046 double resamplethreshold,
00047 int resamplescheme,
00048 int maintainMixturePeriod)
00049 : MixtureParticleFilter<SVar,MVar>(prior,post,NULL,resampleperiod,
00050 resamplethreshold,
00051 resamplescheme,
00052 maintainMixturePeriod)
00053 {
00054
00055
00056 this->_proposal_depends_on_meas = false;
00057 }
00058
00059
00060
00061
00062 template <typename SVar, typename MVar>
00063 MixtureBootstrapFilter<SVar,MVar>::~MixtureBootstrapFilter(){}
00064
00065 template <typename SVar, typename MVar> bool
00066 MixtureBootstrapFilter<SVar,MVar>::UpdateInternal(SystemModel<SVar>* const sysmodel,
00067 const SVar& u,
00068 MeasurementModel<MVar,SVar>* const measmodel,
00069 const MVar& z,
00070 const SVar& s)
00071 {
00072 bool result = true;
00073
00074 if (sysmodel != NULL){
00075 this->ProposalSet(sysmodel->SystemPdfGet());
00076 result = this->MixtureParticleFilter<SVar,MVar>::UpdateInternal(sysmodel,u,NULL,z,s) && result;
00077 }
00078 if (measmodel != NULL)
00079 result = this->MixtureParticleFilter<SVar,MVar>::UpdateInternal(NULL,u,measmodel,z,s) && result;
00080
00081 return result;
00082 }
00083