32 #ifndef __MIXTURE_PARTICLE_FILTER__
33 #define __MIXTURE_PARTICLE_FILTER__
36 #include "../pdf/conditionalpdf.h"
37 #include "../pdf/mcpdf.h"
38 #include "../pdf/mixture.h"
42 #define DEFAULT_RS MULTINOMIAL_RS // Default scheme = MULTINOMIAL
43 #define MULTINOMIAL_RS 0
61 #define SYSTEMATIC_RS 1
82 #define STRATIFIED_RS 2
114 #define MINIMUM_VARIANCE_RS 4
179 typename vector<WeightedSample<StateVar> >::iterator
_os_it;
181 typename vector<WeightedSample<StateVar> >::iterator
_ns_it;
320 int resampleperiod = 0,
321 double resamplethreshold = 0,
322 int resamplescheme = DEFAULT_RS,
323 int maintainMixturePeriod = 1 );
343 int resampleperiod = 0,
344 double resamplethreshold = 0,
345 int resamplescheme = DEFAULT_RS,
346 int maintainMixturePeriod = 1 );
375 #include "mixtureParticleFilter.cpp"
379 #endif // __MIXTURE_PARTICLE_FILTER__
Abstract class representing an interface for Bayesian Filters.
virtual void ProposalSet(ConditionalPdf< StateVar, StateVar > *const cpdf)
Set the proposal density.
virtual bool ResampleOne(int component)
Actual Resampling for one component;.
Virtual Class representing all Mixture particle filters.
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 DynamicResampleStepOne(int component)
Resampling for one component.
double _resampleThreshold
Threshold used when dynamic resampling.
virtual void Reset(Mixture< StateVar > *prior)
Reset Filter.
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.
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.
int _resampleScheme
Which resample algorithm (see top of particle.h for #defines)
bool _proposal_depends_on_meas
Proposal depends on last measurement?
bool _created_post
created own post
virtual bool ProposalStepInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Proposal step.
bool _dynamicResampling
Dynamic resampling or fixed period resampling?
virtual ~MixtureParticleFilter()
Destructor.
vector< vector< WeightedSample< StateVar > > > _old_samplesVec
While updating store list of old samples.
int _maintainMixturePeriod
Number of timestep between mixture maintainance of the Posterior.
vector< vector< Sample< StateVar > > > _new_samples_unweightedVec
While resampling.
virtual bool Resample()
Actual Resampling happens here;.
Class representing a mixture of PDFs, the mixture can contain different.
MixtureParticleFilter(Mixture< StateVar > *prior, ConditionalPdf< StateVar, StateVar > *proposal, int resampleperiod=0, double resamplethreshold=0, int resamplescheme=DEFAULT_RS, int maintainMixturePeriod=1)
Constructor.
vector< WeightedSample< StateVar > >::iterator _os_it
Iterator for old list of samples.
Class representing a mixture of PDFs, the mixture can contain different.
WeightedSample< StateVar > _sample
While updating use sample<StateVar>
virtual bool StaticResampleStep()
Resample if wanted.
ConditionalPdf< StateVar, StateVar > * ProposalGet()
Get a pointer to the proposal density.
vector< Probability > _sumWeights
Vector containing the sum of weights during update step.
virtual bool MaintainMixture()
Actual mixture maintainance happens here;.
virtual bool UpdateWeightsInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Update Weights.
int _resamplePeriod
Number of timestep between resampling from the Posterior Pdf.
virtual Mixture< StateVar > * PostGet()
Get Posterior density.
vector< WeightedSample< StateVar > >::iterator _ns_it
Iterator for new list of samples.
virtual bool DynamicResampleStep()
Resample if necessary.
ConditionalPdf< StateVar, StateVar > * _proposal
Pointer to the Proposal Density.
vector< vector< WeightedSample< StateVar > > > _new_samplesVec
While updating store list of new samples.
vector< Probability > _newMixtureWeights
Vector containing the new mixture weights during update step.
virtual bool MaintainMixtureStep()
Maintain Mixture if wanted.