The base abstract class for devices (sensors and motors) with noise. More...

Inheritance diagram for NoisyDevice:

Public Member Functions

 NoisyDevice (ConfigurationParameters &params, QString prefix)
 Constructor and Configure. More...
 
 ~NoisyDevice ()
 Destructor. More...
 
void save (ConfigurationParameters &params, QString prefix)
 Save the parameters into the ConfigurationParameters. More...
 
- Public Member Functions inherited from ParameterSettableInConstructor
 ParameterSettableInConstructor (ConfigurationParameters &, QString)
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
virtual ParameterSettableUIgetUIManager ()
 
virtual void postConfigureInitialization ()
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 

Static Public Member Functions

static void describe (QString type)
 Describe all the parameter for configuring the Sensor. More...
 
- Static Public Member Functions inherited from ParameterSettable
static void describe (QString type)
 
static QString fullParameterDescriptionPath (QString type, QString param)
 
static QString fullSubgroupDescriptionPath (QString type, QString sub)
 

Protected Member Functions

double applyNoise (double v, double minValue, double maxValue) const
 Adds noise to the value. More...
 
- Protected Member Functions inherited from ParameterSettable
void notifyChangesToParam (QString paramName)
 

Additional Inherited Members

- Public Types inherited from ParameterSettable
enum  Property
 
- Public Attributes inherited from ParameterSettable
 AllowMultiple
 
 Default
 
 IsList
 
 IsMandatory
 
- Static Public Attributes inherited from ParameterSettable
static const double Infinity
 
static const int MaxInteger
 
static const int MinInteger
 
- Static Protected Member Functions inherited from ParameterSettable
static Descriptor addTypeDescription (QString type, QString shortHelp, QString longHelp=QString(""))
 
static void setGraphicalEditor (QString type)
 

Detailed Description

The base abstract class for devices (sensors and motors) with noise.

This class provides parameters and a function to add noise. You can add either uniform noise or gaussian noise in a range. The parameters regarding noise are:

  • noiseType: set to either NoNoise, Uniform or Gaussian to select the type of distribution of noise (respectively no noise, uniform noise in a range or gaussian noise)
  • noiseRange: the range of noise. For uniform noise this is the actual range, (the distribution has zero mean and goes from -noiseRange/2 to noiseRange/2). For gaussian noise, this is four times the standard deviation (the distribution has zero mean and noiseRange/4 standard deviation: this means that about 95% of the values taken from the distribution will be between -noiseRange/2 and noiseRange/2) To apply noise in the code you have to use the applyNoise() function. The function takes the value to which noise should be applied and the expected range of the value and returns the value with added noise.

Definition at line 113 of file neuroninterfaces.h.

Constructor & Destructor Documentation

NoisyDevice ( ConfigurationParameters params,
QString  prefix 
)

Constructor and Configure.

Parameters
paramsis the ConfigurationParameters containing the parameters
prefixis the path prefix to the paramters for this Sensor

Definition at line 31 of file neuroninterfaces.cpp.

References ConfigurationHelper::getDouble(), ConfigurationHelper::getString(), ConfigurationParameters::getValue(), and ConfigurationHelper::throwUserConfigError().

Destructor.

Definition at line 66 of file neuroninterfaces.cpp.

Member Function Documentation

void describe ( QString  type)
static

Describe all the parameter for configuring the Sensor.

Parameters
typethe name of the type

Definition at line 89 of file neuroninterfaces.cpp.

References ParameterSettable::addTypeDescription(), and ParameterSettable::Infinity.

Referenced by Sensor::describe(), and Motor::describe().

void save ( ConfigurationParameters params,
QString  prefix 
)
virtual

Save the parameters into the ConfigurationParameters.

Parameters
paramsis the ConfigurationParameters where save the parameters
prefixis the path prefix for the parameters to save

Implements ParameterSettable.

Reimplemented in Motor, Sensor, ObjectPositionSensor, and FakeSensor.

Definition at line 70 of file neuroninterfaces.cpp.

References ConfigurationParameters::createParameter(), and ConfigurationParameters::startObjectParameters().

Referenced by Sensor::save(), and Motor::save().


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