A class to implement a mean filter.
More...
#include <Filter.h>
|
void | init (unsigned int length) |
|
double | value () |
|
double | value (double v) |
|
|
unsigned int | n |
| Number of elements.
|
|
unsigned int | i |
| Current element's index (circular buffer)
|
|
std::vector< double > | _elements |
| Element container.
|
|
A class to implement a mean filter.
◆ init()
void agent_model::Filter::init |
( |
unsigned int |
length | ) |
|
|
inline |
Initializes the filter with its length The length is equal to the number of elements of which the mean value is calculated
- Parameters
-
length | Length of the filter |
◆ value() [1/2]
double agent_model::Filter::value |
( |
| ) |
|
|
inline |
Returns the filtered mean value of the elements
- Returns
- Filtered mean value
◆ value() [2/2]
double agent_model::Filter::value |
( |
double |
v | ) |
|
|
inline |
Adds the current value and returns the actual filtered value
- Parameters
-
- Returns
- The mean value
The documentation for this class was generated from the following file: