ControllerUtil Class Reference

#include <controllerUtil.h>

List of all members.

Classes

struct  HistoryMap

Static Public Member Functions

static float computeAverage (HistoryMap *histMap, float currentValue)
static int computeAverageClassification (HistoryMap *histMap, float currentValue)

Detailed Description

This file positionUtil.h is created at Almende B.V. It is open-source software and part of the Common Hybrid Agent Platform (CHAP). A toolbox with a lot of open-source tools. Ranging from thread pools, and TCP/IP components to control architectures and learning algorithms.

There are no licenses involved.

Author:
Anne C. van Rossum
Date:
Jan 18, 2010
Project:
Replicator FP7
Company:
Almende B.V.
Cases:

Definition at line 21 of file controllerUtil.h.


Member Function Documentation

float ControllerUtil::computeAverage ( HistoryMap histMap,
float  currentValue 
) [static]

This function gives a weighted value based on the history of values. When a value is requested, it is weighted using the number of previous encountered values. This function is for example used to average a series of location estimates.

If the history size is for example 4, then the previous value is weighted as 3/4, then one after that 2/4 and the last one 1/4. If a sensor does not have a proper value it is possible to write a defaultValue into the array. If all values in the array are equal to the defaultValue, the defaultValue will be returned.

Parameters:
histMap 
currentValueIndex 
Returns:
the average (or the default value)

Definition at line 45 of file controllerUtil.cpp.

References ControllerUtil::HistoryMap::currentValueIndex, ControllerUtil::HistoryMap::defaultValue, ControllerUtil::HistoryMap::history, and ControllerUtil::HistoryMap::historySize.

int ControllerUtil::computeAverageClassification ( HistoryMap histMap,
float  currentValue 
) [static]

This function stores a queue of values just as computeAverage.

Parameters:
histMap 
currentValueIndex 
Returns:

Definition at line 106 of file controllerUtil.cpp.

References ControllerUtil::HistoryMap::currentValueIndex, ControllerUtil::HistoryMap::history, and ControllerUtil::HistoryMap::historySize.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations

Generated on Thu Feb 4 16:32:04 2010 for Delta3D Plugin by  doxygen 1.6.1