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: measuremodes.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/24 11:57:00 der 00031 * added new measure types 00032 * 00033 * Revision 1.2 2008/03/12 10:57:07 der 00034 * added moving average MOVAVG 00035 * 00036 * Revision 1.1 2007/09/27 10:56:40 robot3 00037 * The enum MeasureModes can be found as from now here. Seems to be better for 00038 * guys who like to implement new statistic measures - the only relevant files 00039 * are measuremodes.h (this one) and statisticmeasure.cpp. 00040 * 00041 * 00042 * * 00043 ***************************************************************************/ 00044 #ifndef _MEASUREMODES_H 00045 #define _MEASUREMODES_H 00046 00047 /** 00048 * usage of the statistictools with different measure modes (examples): 00049 * 00050 * adds following measure: the force of the nimm2, ID = the force itself, 00051 * 3 = has no effect? 00052 * stats->addMeasure(myNimm2->getForce(), "force", ID, 3); 00053 * 00054 * next: the average of the observed value (force), AVG = average, 00055 * 50 = average over 50 timesteps (stepspan=50) 00056 * stats->addMeasure(myNimm2->getForce(), "forceAvg50", AVG, 50); 00057 * 00058 * next: the medium of the oserved value (force), MED = medium, 00059 * 3 = medium over 3 timesteps (stepspan=3) 00060 * stats->addMeasure(myNimm2->getForce(), "forceMed3", MED, 3); 00061 * 00062 * next: the peak of the observed value above a given threshold 00063 * stats->addMeasure(myNimm2->getForce(), "forcePeak1", PEAK, 0, 1.0); 00064 * 00065 * 00066 */ 00067 00068 00069 /** measure modes of statistical types. If you add a measure mode, you have 00070 * naturally to implement this measuremode in statisticmeasure.cpp - 00071 * see method StatisticMeasure::step() ! 00072 */ 00073 enum MeasureMode { 00074 /// returns the value to observe itself 00075 ID, 00076 /// returns the average value 00077 AVG, 00078 /// returns the moving average value 00079 MOVAVG, 00080 /// returns the median value 00081 MED, 00082 /// returns the minimum value 00083 MIN, 00084 /// returns the maximum value 00085 MAX, 00086 /// returns only values above defined limit 00087 PEAK, 00088 /// returns the sum of the value generated over time (or stepSpan) 00089 SUM, 00090 /// returns 1 if convergence is reached, otherwise 0 00091 /// convergence criteria (epsilon) is given by addMeasure, the convergence 00092 /// is reached if value is falling below the criteria of the measure time (stepSpan) 00093 CONV, 00094 /// returns the difference between two successive steps 00095 STEPDIFF, 00096 /// returns the difference between two successive steps, normalized with number of steps 00097 NORMSTEPDIFF 00098 }; 00099 00100 #endif