00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * frankguettler@gmx.de * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the * 00020 * Free Software Foundation, Inc., * 00021 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00022 *************************************************************************** 00023 * * 00024 * DESCRIPTION * 00025 * * 00026 * $Log: abstractmeasure.h,v $ 00027 * Revision 1.1 2009/03/27 06:16:57 guettler 00028 * support for gcc 4.3 compatibility (has to be checked), StatisticTools moves from utils to statistictools 00029 * 00030 * Revision 1.3 2008/04/29 08:51:54 guettler 00031 * -cosmetic changes of StatisticTools 00032 * -StatisticTools now uses new function addInspectableValue of the 00033 * interface Inspectable, not overloading getInternalParams and 00034 * getInternalParamNames anymore 00035 * 00036 * Revision 1.2 2008/01/14 09:09:23 der 00037 * added stepSize. An abstractmeasure can now be calculated every stepSize 00038 * steps. 00039 * 00040 * Revision 1.1 2007/12/06 10:18:10 der 00041 * AbstractMeasure is now a abstract type for Measures, 00042 * StatisticTools now supports AbstractMeasures, 00043 * StatisticalMeasure, ComplexMeasure now derived from 00044 * AbstractMeasure, 00045 * ComplexMeasure provides support for calculation e.g. entropy, 00046 * uses Discretisizer, 00047 * Discretisizer is a stand-alone class for support of discretisizing values 00048 * TrackableMeasure derived from ComplexMeasure and provides support for calculating complex measures for Trackable objects 00049 * 00050 * Revision 1.3 2007/09/28 08:48:21 robot3 00051 * corrected some minor bugs, files are still in develop status 00052 * 00053 * Revision 1.2 2007/09/27 10:49:39 robot3 00054 * removed some minor bugs, 00055 * added CONVergence test 00056 * changed little things for support of the new WSM 00057 * 00058 * Revision 1.1 2007/05/07 21:01:31 robot3 00059 * statistictools is a class for easy visualization of measurements of observed values 00060 * it is possible to add the observed value itself with mode ID 00061 * 00062 * * 00063 ***************************************************************************/ 00064 #ifndef _ABSTRACT_MEASURE_H 00065 #define _ABSTRACT_MEASURE_H 00066 00067 #import <iostream> 00068 #import "imeasure.h" 00069 00070 /** 00071 * Class used by StatisticTools. 00072 * Provides an interface for any kind of time series analysis. 00073 * Every step the StatisticTools calls step. 00074 * @sa StatisticTools 00075 * @sa HUDStatisticsManager 00076 * @sa IMeasure 00077 */ 00078 class AbstractMeasure : public IMeasure 00079 { 00080 00081 public: 00082 00083 AbstractMeasure(const char* measureName) : name(measureName), value(0.0), actualStep(0), stepSize(1) {} 00084 00085 virtual ~AbstractMeasure() {} 00086 00087 00088 virtual std::string getName() const { return name; } 00089 00090 virtual double getValue() const { return value; } 00091 00092 virtual double& getValueAddress() { return value; } 00093 00094 virtual void setStepSize(int newStepSize) { stepSize=newStepSize; } 00095 00096 virtual int getStepSize() const { return stepSize; } 00097 00098 virtual long getActualStep() const { return actualStep; } 00099 00100 00101 protected: 00102 std::string name; 00103 double value; // this is the value which is determined, e.g. in AVG MeasureMode, it's the average! 00104 00105 long actualStep; // actual step 00106 int stepSize; 00107 }; 00108 00109 #endif