Bayesian Filtering Library Generated from SVN r
measurementmodel.h
1// $Id$
2// Copyright (C) 2002 Klaas Gadeyne <first dot last at gmail dot com>
3//
4 /***************************************************************************
5 * This library is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public *
7 * License as published by the Free Software Foundation; *
8 * version 2 of the License. *
9 * *
10 * As a special exception, you may use this file as part of a free *
11 * software library without restriction. Specifically, if other files *
12 * instantiate templates or use macros or inline functions from this *
13 * file, or you compile this file and link it with other files to *
14 * produce an executable, this file does not by itself cause the *
15 * resulting executable to be covered by the GNU General Public *
16 * License. This exception does not however invalidate any other *
17 * reasons why the executable file might be covered by the GNU General *
18 * Public License. *
19 * *
20 * This library is distributed in the hope that it will be useful, *
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
23 * Lesser General Public License for more details. *
24 * *
25 * You should have received a copy of the GNU General Public *
26 * License along with this library; if not, write to the Free Software *
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
28 * Boston, MA 02110-1301 USA *
29 * *
30 ***************************************************************************/
31//
32#ifndef __MEASUREMENT_MODEL__
33#define __MEASUREMENT_MODEL__
34
35#include "../pdf/conditionalpdf.h"
36
37namespace BFL
38{
39
40#define NUMBER_OF_CONDITIONAL_ARGS 2
41
53 template<typename MeasVar, typename StateVar> class MeasurementModel {
54 protected:
56 /* @bug Since, for now, the library only supports only conditional
57 arguments of the same type, both X and U have to be of the same
58 type (ie both continu or both discrete!). I imagine there must
59 be systems for which this approach is not general enough @see
60 ConditionalPdf
61 */
63
66
67 public:
69
76
78 int MeasurementSizeGet() const;
79
82
85
87
90
92
103 MeasVar Simulate (const StateVar& x, const StateVar& s, const SampleMthd sampling_method = SampleMthd::DEFAULT, void * sampling_args = NULL);
104
106
116 MeasVar Simulate (const StateVar& x, const SampleMthd sampling_method = SampleMthd::DEFAULT, void * sampling_args = NULL);
117
119
125 Probability ProbabilityGet(const MeasVar& z, const StateVar& x, const StateVar& s );
126
128
134 Probability ProbabilityGet(const MeasVar& z, const StateVar& x );
135 };
136
137#include "measurementmodel.cpp"
138
139} // End namespace BFL
140
141#endif // __MEASUREMENT_MODEL__
Abstract Class representing conditional Pdfs P(x | ...)
MeasurementModel(ConditionalPdf< MeasVar, StateVar > *Measurementpdf=NULL)
Constructor.
int MeasurementSizeGet() const
Get Measurement Size.
MeasVar Simulate(const StateVar &x, const SampleMthd sampling_method=SampleMthd::DEFAULT, void *sampling_args=NULL)
Simulate the system (no input system)
bool SystemWithoutSensorParams() const
Number of Conditional Arguments.
Probability ProbabilityGet(const MeasVar &z, const StateVar &x, const StateVar &s)
Get the probability of a certain measurement.
ConditionalPdf< MeasVar, StateVar > * _MeasurementPdf
ConditionalPdf representing .
bool _systemWithoutSensorParams
System with no sensor params??
MeasVar Simulate(const StateVar &x, const StateVar &s, const SampleMthd sampling_method=SampleMthd::DEFAULT, void *sampling_args=NULL)
Simulate the Measurement, given a certain state, and an input.
virtual ~MeasurementModel()
Destructor.
void MeasurementPdfSet(ConditionalPdf< MeasVar, StateVar > *pdf)
Set the MeasurementPDF.
Probability ProbabilityGet(const MeasVar &z, const StateVar &x)
Get the probability of a certain measurement.
ConditionalPdf< MeasVar, StateVar > * MeasurementPdfGet()
Get the MeasurementPDF.
Class representing a probability (a double between 0 and 1)