Bayesian Filtering Library Generated from SVN r
histogramfilter.h
1// $Id: histogramfilter.h 14935 2007-12-17 $
2// Copyright (C) 2007 Tinne De Laet <tinne dot delaet at mech dot kuleuven dot be>
3//
4// This program is free software; you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as published by
6// the Free Software Foundation; either version 2.1 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program; if not, write to the Free Software
16// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17//
18
19#ifndef __HISTOGRAM_FILTER__
20#define __HISTOGRAM_FILTER__
21
22#include "filter.h"
23#include "../pdf/discretepdf.h"
24#include "../model/measurementmodel.h"
25#include "../model/discretesystemmodel.h"
26
27namespace BFL
28{
29
31
49template <typename MeasVar> class HistogramFilter : public Filter<int,MeasVar>
50{
51public:
53
56 HistogramFilter(DiscretePdf* prior);
57
59 virtual ~HistogramFilter();
60
61 // implement virtual function
62 virtual DiscretePdf* PostGet();
63
64protected:
66 vector<Probability > _old_prob;
68 vector<Probability > _new_prob;
69
74 void SysUpdate(SystemModel<int>* const sysmodel,
75 const int& u);
76
78
86 void MeasUpdate(MeasurementModel<MeasVar,int>* const measmodel,
87 const MeasVar& z,
88 const int& s);
89
90 bool UpdateInternal(SystemModel<int>* const sysmodel,
91 const int& u,
92 MeasurementModel<MeasVar,int>* const measmodel,
93 const MeasVar& z,
94 const int& s);
95}; // class
96
97
98#include "histogramfilter.cpp"
99
100} // End namespace BFL
101
102#endif // __HISTOGRAM_FILTER__
Abstract class representing an interface for Bayesian Filters.
Definition filter.h:78
Class representing the histogram filter.
vector< Probability > _new_prob
While updating store list of new probabilities.
HistogramFilter(DiscretePdf *prior)
Constructor.
virtual DiscretePdf * PostGet()
Get Posterior density.
virtual ~HistogramFilter()
Destructor.
bool UpdateInternal(SystemModel< int > *const sysmodel, const int &u, MeasurementModel< MeasVar, int > *const measmodel, const MeasVar &z, const int &s)
Actual implementation of Update, varies along filters.
void MeasUpdate(MeasurementModel< MeasVar, int > *const measmodel, const MeasVar &z, const int &s)
Measurement Update.
void SysUpdate(SystemModel< int > *const sysmodel, const int &u)
vector< Probability > _old_prob
While updating store list of old probabilities.