neuroninterfaces.cpp
37 QString noiseTypeStr = ConfigurationHelper::getString(params, prefix + "noiseType", "NoNoise").toUpper();
45 ConfigurationHelper::throwUserConfigError("noiseType", params.getValue(prefix + "noiseType"), "The noiseType must be one of NoNoise, Uniform or Gaussian");
49 ConfigurationHelper::throwUserConfigError("noiseRange", params.getValue(prefix + "noiseRange"), "The noiseRange parameter must be a real value greater or equal to 0");
91 Descriptor d = addTypeDescription( type, "Base class for all noisy devices (sensors and motors)" );
92 d.describeEnum("noiseType").def("NoNoise").values(QStringList() << "NoNoise" << "Uniform" << "Gaussian").help("The type of noise to add to sensor readings", "This must be one of NoNoise, Uniform or Gaussian. Notice that not all sensors respect the value of this parameter (some may never add noise). See sensor description for more information");
93 d.describeReal("noiseRange").def(0.0f).limits(0.0,+Infinity).help("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)");
174 ConfigurationHelper::throwUserMissingResourceError(nonExistingResources.join(", "), "Some required resource do not exist, cannot use " + sensorName + " anymore");
240 ConfigurationHelper::throwUserMissingResourceError(nonExistingResources.join(", "), "Some required resource do not exist, cannot use " + motorName + " anymore");
291 throw EvonetIteratorInvalidStatusException( "setCurrentBlock", QString("EvonetIterator - the block %1 does not exist").arg(blockName).toLatin1().data());
329 void EvonetIterator::setGraphicProperties( QString label, double minValue, double maxValue, QColor color ) {
347 throw EvonetIteratorInvalidStatusException( funcName.toLatin1().data(), "no Evonet object has ben set");
350 throw EvonetIteratorInvalidStatusException( funcName.toLatin1().data(), "you should call setCurrentBlock first");
353 throw EvonetIteratorInvalidStatusException( funcName.toLatin1().data(), "attempt to access beyond the size of the current block");
static void describe(QString type)
Describe all the parameter for configuring the Sensor.
Definition: neuroninterfaces.cpp:89
double applyNoise(double v, double minValue, double maxValue) const
Adds noise to the value.
Definition: neuroninterfaces.cpp:96
static void throwUserMissingResourceError(QString resourceName, QString description)
QString actualResourceNameForMultirobot(QString resourceName) const
Returns the actual resource name to use.
Definition: neuroninterfaces.cpp:185
FARSA_UTIL_API RandomGenerator * globalRNG
static QString getString(ConfigurationParameters ¶ms, QString paramPath, QString def=QString())
void save(ConfigurationParameters ¶ms, QString prefix)
Save the parameters into the ConfigurationParameters.
Definition: neuroninterfaces.cpp:201
void setName(QString name)
Use this method for changing the name of the Sensor.
Definition: neuroninterfaces.cpp:161
bool setCurrentBlock(QString blockName)
Set the current blocks of neurons to iterate.
Definition: neuroninterfaces.cpp:289
layer_t
enum the possible layers on which the blocks can be defined
Definition: neuroninterfaces.h:346
static const double Infinity
void checkAllNeededResourcesExist()
Checks whether all resources we need are existing and throws an exception if they aren't...
Definition: neuroninterfaces.cpp:231
void resetNeededResourcesCheck()
Resets the check on needed resources so that the next call to checkAllNeededResourcesExist() will per...
Definition: neuroninterfaces.cpp:246
Motor(ConfigurationParameters ¶ms, QString prefix)
Constructor and Configure.
Definition: neuroninterfaces.cpp:190
static void describe(QString type)
Describe all the parameter for configuring the Sensor.
Definition: neuroninterfaces.cpp:148
static void throwUserConfigError(QString paramName, QString paramValue, QString description)
void setGraphicProperties(QString label, double minValue, double maxValue, QColor color)
Set the graphic properties for the current neuron (in case it will be visualized on a GUI) ...
Definition: neuroninterfaces.cpp:329
bool updateNeuronMonitor
Set to true if labels or colors have to be updated in the neuron monitor.
Definition: evonet.h:431
The base abstract class for devices (sensors and motors) with noise.
Definition: neuroninterfaces.h:113
Sensor(ConfigurationParameters ¶ms, QString prefix)
Constructor and Configure.
Definition: neuroninterfaces.cpp:123
Evonet * getEvonet()
Return the Evonet on which it will iterate on.
Definition: neuroninterfaces.cpp:277
void save(ConfigurationParameters ¶ms, QString prefix)
Save the parameters into the ConfigurationParameters.
Definition: neuroninterfaces.cpp:70
QColor neurondcolor[MAXN]
the color used to display the actiovation state of each neuron in the neuron monitor widget ...
Definition: evonet.h:419
void resetNeededResourcesCheck()
Resets the check on needed resources so that the next call to checkAllNeededResourcesExist() will per...
Definition: neuroninterfaces.cpp:180
bool usedResourcesExist(QStringList *nonExistingResources=NULL) const
bool startObjectParameters(QString groupPath, QString typeName, ParameterSettable *object)
static double getDouble(ConfigurationParameters ¶ms, QString paramPath, double def=0)
static Descriptor addTypeDescription(QString type, QString shortHelp, QString longHelp=QString(""))
void defineBlock(QString name, layer_t layer, int startIndex, int size)
Define a block.
Definition: neuroninterfaces.cpp:281
QString getValue(QString path, bool alsoMatchParents=false) const
QString actualResourceNameForMultirobot(QString resourceName) const
Returns the actual resource name to use.
Definition: neuroninterfaces.cpp:251
The exception thrown when EvonetIterator is not in a valid status.
Definition: neuroninterfaces.h:418
void setName(QString name)
Use this method for changing the name of the Sensor.
Definition: neuroninterfaces.cpp:227
float getOutput(int out)
return the value of a motor neuron (-1 if the specified id is out of range)
Definition: evonet.cpp:1025
double getGaussian(double var, double mean=0.0)
double getDouble(double min, double max)
void save(ConfigurationParameters ¶ms, QString prefix)
Save the parameters into the ConfigurationParameters.
Definition: neuroninterfaces.cpp:134
NoisyDevice(ConfigurationParameters ¶ms, QString prefix)
Constructor and Configure.
Definition: neuroninterfaces.cpp:31
void checkAllNeededResourcesExist()
Checks whether all resources we need are existing and throws an exception if they aren't...
Definition: neuroninterfaces.cpp:165
static void describe(QString type)
Describe all the parameter for configuring the Motor.
Definition: neuroninterfaces.cpp:214
void setInput(double value)
Set the input of the current neuron.
Definition: neuroninterfaces.cpp:311
void createParameter(QString groupPath, QString parameter)
double neuronrange[MAXN][2]
the matrix that contain the variation range of neurons used by the neuron monitor graphic widget ...
Definition: evonet.h:415