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
StatisticTools Class Reference

TODO: add possibility to pass description of a measure. More...

#include <statistictools.h>

Inheritance diagram for StatisticTools:
Collaboration diagram for StatisticTools:

Public Member Functions

 StatisticTools (const std::string &name="StatisticTools")
 
virtual double & addMeasure (double &observedValue, const char *measureName, MeasureMode mode, long stepSpan, double additionalParam=0)
 adds a variable to observe and measure the value More...
 
virtual StatisticMeasuregetMeasure (double &observedValue, const char *measureName, MeasureMode mode, long stepSpan, double additionalParam=0)
 Same as the method above, but instead of getting the calculated value back (the adress), you get the StatisticMeasure itself. More...
 
virtual AbstractMeasuregetMeasure (const std::string &measureName) const
 returns a measure that is already in the pool (or 0 if not found) More...
 
virtual double & addMeasure (AbstractMeasure *measure)
 You can add another abstract measure you like. More...
 
virtual double & addMeasureList (std::list< AbstractMeasure * > measureList)
 You can add another abstract measure you like. More...
 
virtual double & addMeasureList (std::list< ComplexMeasure * > measureList)
 You can add another abstract measure you like. More...
 
virtual double & addMeasureList (std::list< StatisticMeasure * > measureList)
 You can add another abstract measure you like. More...
 
virtual void beginMeasureAt (long step)
 starts the measure at a specific time. More...
 
virtual bool measureStarted ()
 Tells you wether the measures have already been started. More...
 
virtual void doOnCallBack (BackCaller *source, BackCaller::CallbackableType type=BackCaller::DEFAULT_CALLBACKABLE_TYPE)
 CALLBACKABLE INTERFACE. More...
 
- Public Member Functions inherited from Inspectable
 Inspectable (const iparamkey &name="")
 TYPEDEFS END. More...
 
virtual ~Inspectable ()
 
virtual iparamkeylist getInternalParamNames () const
 The list of the names of all internal parameters given by getInternalParams(). More...
 
virtual iparamvallist getInternalParams () const
 
virtual iparamvalptrlist getInternalParamsPtr () const
 be careful: matrices will be ignored More...
 
virtual ilayerlist getStructuralLayers () const
 Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important. More...
 
virtual iconnectionlist getStructuralConnections () const
 Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important. More...
 
virtual void addInspectableValue (const iparamkey &key, iparamval const *val, const std::string &descr=std::string())
 This is the new style for adding inspectable values. More...
 
virtual void addInspectableMatrix (const iparamkey &key, const matrix::Matrix *m, bool only4x4AndDiag=true, const std::string &descr=std::string())
 This is the new style for adding inspectable values. More...
 
virtual void addInspectableDescription (const iparamkey &key, const std::string &descr)
 adds a description for the given parameter using info-lines The line will start (appart from the #I) with a D for description followed by the key end then followed by the string. More...
 
virtual void addInfoLine (std::string infoLine)
 Adds an info line to this inspectable instance. More...
 
virtual void addInfoLines (std::list< std::string > infoLineList)
 Adds a bunch of infolines with addInfoLine to this inspectable instance. More...
 
virtual void removeInfoLines ()
 Removes all infolines from this inspectable instance. More...
 
virtual const infoLinesListgetInfoLines () const
 Returns all infolines added to this inspectable instance. More...
 
virtual void addInspectable (Inspectable *insp)
 Adds an inspectable as a child object. More...
 
virtual void removeInspectable (Inspectable *insp)
 Removes an inspectable as a child object. More...
 
virtual void setNameOfInspectable (const iparamkey &name)
 set the name of the inspectable More...
 
virtual const iparamkey getNameOfInspectable () const
 return the name of the inspectable, getName() would conflict with Configurable::getName() too often More...
 
virtual const inspectableListgetInspectables () const
 Returns the list containing all inspectable children. More...
 
- Public Member Functions inherited from Callbackable
 Callbackable ()
 
virtual ~Callbackable ()
 

Protected Attributes

std::list< AbstractMeasure * > activeMeasures
 
long beginMeasureCounter
 
- Protected Attributes inherited from Inspectable
iparamkey name
 
iparampairlist mapOfValues
 
imatrixpairlist mapOfMatrices
 
infoLinesList infoLineStringList
 

Additional Inherited Members

- Public Types inherited from Inspectable
typedef std::string iparamkey
 
typedef double iparamval
 
typedef std::pair< iparamkey,
iparamval const * > 
iparampair
 
typedef std::pair< iparamkey,
std::pair< const
matrix::Matrix *, bool > > 
imatrixpair
 
typedef std::list< iparamkeyiparamkeylist
 
typedef std::list< std::string > infoLinesList
 
typedef std::list< iparamvaliparamvallist
 
typedef std::list< iparamval
const * > 
iparamvalptrlist
 
typedef std::list< iparampairiparampairlist
 
typedef std::list< imatrixpairimatrixpairlist
 
typedef struct Inspectable::ILayer ILayer
 
typedef struct
Inspectable::IConnection 
IConnection
 
typedef std::list< ILayerilayerlist
 
typedef std::list< IConnectioniconnectionlist
 
typedef std::list< const
Inspectable * > 
inspectableList
 

Detailed Description

TODO: add possibility to pass description of a measure.

Constructor & Destructor Documentation

StatisticTools ( const std::string &  name = "StatisticTools")
inline

Member Function Documentation

double & addMeasure ( double &  observedValue,
const char *  measureName,
MeasureMode  mode,
long  stepSpan,
double  additionalParam = 0 
)
virtual

adds a variable to observe and measure the value

Parameters
observedValuethe value to observe.
measureNamethe name of the measured value
modethe mode of measure
stepSpanin most cases the stepSpan is important to get the measured value of a number of steps, like AVG: if stepSpan = 0, AVG is calculated over all steps if stepSpan = n, AVG is calculated over the LAST n steps The same counts for all the other MeasureModes.
additionalParamis used for example for mode PEAK, the param is the limit value, all values minus limit are displayed, values below the limit are set to 0. In CONV mode (test the convergence), this value is the epsilon criteria.
Returns
measured value as adress. So it is possible to measure this value again
double & addMeasure ( AbstractMeasure measure)
virtual

You can add another abstract measure you like.

in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized

Parameters
measurethe measure to add
Returns
the address value of the measure
double & addMeasureList ( std::list< AbstractMeasure * >  measureList)
virtual

You can add another abstract measure you like.

in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized With this method you can add a list of AbstractMeasures.

Parameters
measureListthe list of measures to add
Returns
the address value of the first measure
double & addMeasureList ( std::list< ComplexMeasure * >  measureList)
virtual

You can add another abstract measure you like.

in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized With this method you can add a list of AbstractMeasures.

Parameters
measureListthe list of measures to add
Returns
the address value of the first measure
double & addMeasureList ( std::list< StatisticMeasure * >  measureList)
virtual

You can add another abstract measure you like.

in some cases (e.g. complex measures) it is better to let the measure decide how it likes to be initialized With this method you can add a list of AbstractMeasures.

Parameters
measureListthe list of measures to add
Returns
the address value of the first measure
void beginMeasureAt ( long  step)
virtual

starts the measure at a specific time.

This is useful if there are values that have to be ignored at simulation start.

Parameters
stepnumber of steps (normally simsteps) to wait for beginning the measures
void doOnCallBack ( BackCaller source,
BackCaller::CallbackableType  type = BackCaller::DEFAULT_CALLBACKABLE_TYPE 
)
virtual

CALLBACKABLE INTERFACE.

this method is invoked when a callback is done from the class where this class is for callback registered

Implements Callbackable.

StatisticMeasure * getMeasure ( double &  observedValue,
const char *  measureName,
MeasureMode  mode,
long  stepSpan,
double  additionalParam = 0 
)
virtual

Same as the method above, but instead of getting the calculated value back (the adress), you get the StatisticMeasure itself.

AbstractMeasure * getMeasure ( const std::string &  measureName) const
virtual

returns a measure that is already in the pool (or 0 if not found)

virtual bool measureStarted ( )
inlinevirtual

Tells you wether the measures have already been started.

Returns
true if measures have already been started, otherwise false

Member Data Documentation

std::list<AbstractMeasure*> activeMeasures
protected
long beginMeasureCounter
protected

The documentation for this class was generated from the following files: