Robot Simulator of the Robotics Group for Self-Organization of Control: abstractmeasure.h Source File

# abstractmeasure.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002  *   Copyright (C) 2005-2011 LpzRobots development team                    *
    00003  *    Georg Martius  <georg dot martius at web dot de>                     *
    00004  *    Frank Guettler <guettler at informatik dot uni-leipzig dot de        *
    00005  *    Frank Hesse    <frank at nld dot ds dot mpg dot de>                  *
    00006  *    Ralf Der       <ralfder at mis dot mpg dot 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 #ifndef _ABSTRACT_MEASURE_H
    00025 #define _ABSTRACT_MEASURE_H
    00026
    00027 #include <iostream>
    00028 #include "imeasure.h"
    00029
    00030 /**
    00031  * Class used by StatisticTools.
    00032  * Provides an interface for any kind of time series analysis.
    00033  * Every step the StatisticTools calls step.
    00034  * @sa StatisticTools
    00035  * @sa HUDStatisticsManager
    00036  * @sa IMeasure
    00037  */
    00038 class AbstractMeasure : public IMeasure
    00039 {
    00040
    00041 public:
    00042
    00043   AbstractMeasure(const char* measureName) : name(measureName), value(0.0), actualStep(0), stepSize(1) {}
    00044
    00045   virtual ~AbstractMeasure() {}
    00046
    00047
    00048   virtual std::string getName() const { return name; }
    00049
    00050   virtual double getValue() const { return value; }
    00051
    00052   virtual double& getValueAddress()  { return value; }
    00053
    00054   virtual void setStepSize(int newStepSize) { stepSize=newStepSize; }
    00055
    00056   virtual int getStepSize() const { return stepSize; }
    00057
    00058   virtual long getActualStep() const { return actualStep; }
    00059
    00060
    00061 protected:
    00062   std::string name;
    00063   double value;  // this is the value which is determined, e.g. in AVG MeasureMode, it's the average!
    00064
    00065   long actualStep; // actual step
    00066   int stepSize;
    00067 };
    00068
    00069 #endif