20 #include "../sample/weightedsample.h" 25 template <
typename SVar,
typename MVar>
28 double resamplethreshold,
31 resamplethreshold, resamplescheme)
43 template <
typename SVar,
typename MVar>
47 template <
typename SVar,
typename MVar>
void 61 int NumSamples = (
dynamic_cast<MCPdf<SV> *
>(this->
_post))->NumSamplesGet();
64 static vector<SV> mu(NumSamples);
65 typename vector<SV>::iterator mu_it = mu.begin();
74 for ( this->
_os_it=this->_old_samples.begin();
75 this->
_os_it != this->_old_samples.end() ;
80 x_old = this->
_os_it->ValueGet();
111 this->
_os_it->WeightSet(this->
_os_it->WeightGet() * weightfactor);
115 (
dynamic_cast<MCPdf<SV> *
>(this->
_post))->ListOfSamplesUpdate(this->_old_samples);
125 if (measmodel != NULL)
135 x_new = this->
_ns_it->ValueGet();
140 else weightfactor = 0;
145 else weightfactor = 0;
146 this->
_ns_it->WeightSet(this->
_ns_it->WeightGet() * weightfactor);
153 this->ResampleStep();
bool SystemWithoutInputs() const
Has the system inputs or not.
virtual ~ASIRFilter()
Destructor.
ASIR: Auxiliary Particle Filter.
Pdf< StateVar > * _post
Pointer to the Posterior Pdf.
Virtual Class representing all particle filters.
virtual void ConditionalArgumentSet(unsigned int n_argument, const CondArg &argument)
Set the n-th argument of the list.
bool _proposal_depends_on_meas
Proposal depends on last measurement?
vector< WeightedSample< StateVar > >::iterator _os_it
Iterator for old list of samples.
Probability ProbabilityGet(const MeasVar &z, const StateVar &x, const StateVar &s)
Get the probability of a certain measurement.
virtual bool Resample()
Actual Resampling happens here;.
vector< WeightedSample< StateVar > > _old_samples
While updating store list of old samples.
ConditionalPdf< T, T > * SystemPdfGet()
Get the SystemPDF.
vector< WeightedSample< StateVar > > _new_samples
While updating store list of new samples.
Monte Carlo Pdf: Sample based implementation of Pdf.
virtual void ProposalSet(ConditionalPdf< StateVar, StateVar > *const cpdf)
Set the proposal density.
virtual bool ProposalStepInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Proposal step.
virtual void UpdateInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
Actual implementation of updateinternal.
virtual T ExpectedValueGet() const
Get the expected value E[x] of the pdf.
vector< WeightedSample< StateVar > >::iterator _ns_it
Iterator for new list of samples.
ConditionalPdf< StateVar, StateVar > * _proposal
Pointer to the Proposal Density.
Class representing a probability (a double between 0 and 1)
bool SystemWithoutSensorParams() const
Number of Conditional Arguments.