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