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 154 :
public Filter<StateVar,MeasVar>
179 typename vector<WeightedSample<StateVar> >::iterator
_os_it;
181 typename vector<WeightedSample<StateVar> >::iterator
_ns_it;
320 int resampleperiod = 0,
321 double resamplethreshold = 0,
323 int maintainMixturePeriod = 1 );
343 int resampleperiod = 0,
344 double resamplethreshold = 0,
346 int maintainMixturePeriod = 1 );
379 #endif // __MIXTURE_PARTICLE_FILTER__ virtual ~MixtureParticleFilter()
Destructor.
Abstract class representing an interface for Bayesian Filters.
vector< vector< WeightedSample< StateVar > > > _new_samplesVec
While updating store list of new samples.
Virtual Class representing all Mixture particle filters.
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.
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.
ConditionalPdf< StateVar, StateVar > * ProposalGet()
Get a pointer to the proposal density.
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.
vector< WeightedSample< StateVar > >::iterator _ns_it
Iterator for new list of samples.
virtual bool Resample()
Actual Resampling happens here;.
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;.
Class representing a mixture of PDFs, the mixture can contain different.
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.
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.
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.
vector< Probability > _sumWeights
Vector containing the sum of weights during update step.
vector< vector< WeightedSample< StateVar > > > _old_samplesVec
While updating store list of old samples.
int _resamplePeriod
Number of timestep between resampling from the Posterior Pdf.
bool _created_post
created own post
bool _dynamicResampling
Dynamic resampling or fixed period resampling?