Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
abstractmeasure.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef _ABSTRACT_MEASURE_H
25 #define _ABSTRACT_MEASURE_H
26 
27 #include <iostream>
28 #include "imeasure.h"
29 
30 /**
31  * Class used by StatisticTools.
32  * Provides an interface for any kind of time series analysis.
33  * Every step the StatisticTools calls step.
34  * @sa StatisticTools
35  * @sa HUDStatisticsManager
36  * @sa IMeasure
37  */
38 class AbstractMeasure : public IMeasure
39 {
40 
41 public:
42 
43  AbstractMeasure(const char* measureName)
44  : name(measureName), value(0.0), actualStep(0), stepSize(1), displayPrecision(6) {}
45 
46  virtual ~AbstractMeasure() {}
47 
48 
49  virtual std::string getName() const { return name; }
50 
51  virtual double getValue() const { return value; }
52 
53  virtual double& getValueAddress() { return value; }
54 
55  virtual void setStepSize(int newStepSize) { stepSize=newStepSize; }
56 
57  virtual int getStepSize() const { return stepSize; }
58 
59  virtual long getActualStep() const { return actualStep; }
60 
61  virtual void setDisplayPrecision(int digits){ displayPrecision=digits; }
62 
63  virtual int getDisplayPrecision() const { return displayPrecision; }
64 
65 
66 protected:
67  std::string name;
68  double value; // this is the value which is determined, e.g. in AVG MeasureMode, it's the average!
69 
70  long actualStep; // actual step
71  int stepSize;
73 };
74 
75 #endif
virtual std::string getName() const
Definition: abstractmeasure.h:49
virtual double getValue() const
Definition: abstractmeasure.h:51
int stepSize
Definition: abstractmeasure.h:71
AbstractMeasure(const char *measureName)
Definition: abstractmeasure.h:43
virtual int getDisplayPrecision() const
Definition: abstractmeasure.h:63
virtual double & getValueAddress()
Definition: abstractmeasure.h:53
virtual void setStepSize(int newStepSize)
Definition: abstractmeasure.h:55
virtual long getActualStep() const
Definition: abstractmeasure.h:59
double value
Definition: abstractmeasure.h:68
virtual void setDisplayPrecision(int digits)
Definition: abstractmeasure.h:61
Class used by StatisticTools.
Definition: imeasure.h:42
int displayPrecision
Definition: abstractmeasure.h:72
virtual int getStepSize() const
Definition: abstractmeasure.h:57
long actualStep
Definition: abstractmeasure.h:70
std::string name
Definition: abstractmeasure.h:67
virtual ~AbstractMeasure()
Definition: abstractmeasure.h:46
Class used by StatisticTools.
Definition: abstractmeasure.h:38