trackablemeasure.h

Go to the documentation of this file.
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: trackablemeasure.h,v $
00027 *   Revision 1.1  2007/12/06 10:18:10  der
00028 *   AbstractMeasure is now a abstract type for Measures,
00029 *   StatisticTools now supports AbstractMeasures,
00030 *   StatisticalMeasure, ComplexMeasure  now derived from
00031 *   AbstractMeasure,
00032 *   ComplexMeasure provides support for calculation e.g. entropy,
00033 *   uses Discretisizer,
00034 *   Discretisizer is a stand-alone class for support of discretisizing values
00035 *   TrackableMeasure derived from ComplexMeasure and provides support for calculating complex measures for Trackable objects
00036 *
00037 *   Revision 1.3  2007/09/28 08:48:21  robot3
00038 *   corrected some minor bugs, files are still in develop status
00039 *
00040 *   Revision 1.2  2007/09/27 10:49:39  robot3
00041 *   removed some minor bugs,
00042 *   added CONVergence test
00043 *   changed little things for support of the new WSM
00044 *
00045 *   Revision 1.1  2007/05/07 21:01:31  robot3
00046 *   statistictools is a class for easy visualization of measurements of observed values
00047 *   it is possible to add the observed value itself with mode ID
00048 *
00049 *                                                                         *
00050 ***************************************************************************/
00051 #ifndef _TRACKABLE_MEASURE_H
00052 #define _TRACKABLE_MEASURE_H
00053 
00054 #include "complexmeasure.h"
00055 #include "trackable.h"
00056 #include <list>
00057 #include "position.h"
00058 
00059 /**
00060  * NOTE: SPEED and ANGSPEED is not implemented yet!
00061  */
00062 enum TrackMode {
00063     POS, /// takes the position for the measure
00064     SPEED, /// takes the speed for the measure
00065     ANGSPEED /// takes the angular speed for the measure
00066 };
00067 
00068 /// defines which dimensions should be count.
00069 enum Dimensions { X = 1, Y = 2, Z = 4 };
00070 
00071 
00072 class TrackableMeasure : public ComplexMeasure {
00073   
00074 public:
00075   
00076   /**
00077    * creates a new TrackableMeasure. The position of the Trackables in the
00078    * given list is counted in a fequency list. The possible positions are
00079    * given by the cornerPointList, which contains the cornerPoints of the
00080    * arena where the trackables are placed.
00081    * the complex measure ist then based on the frequency list
00082    * @param trackableList the list of the Trackables
00083    * @param cornerPointList the list with the cornerPoints of the arena
00084    * @param dimensions which dimensions do you like to count? Note that
00085    * the needed memory is (numberBins^ndim), but calculation costs are O(1)
00086    * @param cmode which type of complex measure should be evaluated?
00087    * @param numberBins number of bins used for discretisation
00088    */
00089   TrackableMeasure(std::list<Trackable*> trackableList,char* measureName  ,ComplexMeasureMode cmode,std::list<Position> cornerPointList, short dimensions, int numberBins);
00090   
00091   
00092 
00093   virtual ~TrackableMeasure();
00094   
00095     /**
00096      * defined by AbstractMeasure. This method is called from StatisticTools
00097         for updating the measure in every simStep (ODE).
00098      */
00099   virtual void step();
00100   
00101   
00102 protected:
00103   std::list<Trackable*> trackableList;
00104   ComplexMeasureMode cmode;
00105   TrackMode tmode;
00106   
00107   virtual double findRange(std::list<Position>  positionList,short dim, bool min);
00108   
00109   virtual void addDimension(short dim, std::list<Position> cornerPointList);
00110   
00111 };
00112 
00113 #endif

Generated on Tue Sep 16 22:00:22 2008 for Robotsystem of the Robot Group Leipzig by  doxygen 1.4.7