This class iterate over the neurons of a Evonet neural network. More...

Inheritance diagram for EvonetIterator:

List of all members.

Classes

class  BlockInfo
 helper structer for mantain information about blocks

Public Types

enum  layer_t { InputLayer, HiddenLayer, OutputLayer }
 

enum the possible layers on which the blocks can be defined

More...

Public Member Functions

 EvonetIterator ()
 Constructor.
virtual ~EvonetIterator ()
 Destructor.
void defineBlock (QString name, layer_t layer, int startIndex, int size)
 Define a block.
double getOutput ()
 Get the output of the current neuron.
bool nextNeuron ()
 Go to the next neuron of the current block.
bool setCurrentBlock (QString blockName)
 Set the current blocks of neurons to iterate.
void setEvonet (Evonet *evonet)
 Set the Evonet on which iterate.
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)
void setInput (double value)
 Set the input of the current neuron.

Detailed Description

This class iterate over the neurons of a Evonet neural network.

The blocks are identified by specifing the start and the end indexes and to which layer are related to.

Definition at line 205 of file neuroninterfaces.h.


Member Enumeration Documentation

enum layer_t

enum the possible layers on which the blocks can be defined

Definition at line 216 of file neuroninterfaces.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 134 of file neuroninterfaces.cpp.

~EvonetIterator ( ) [virtual]

Destructor.

Definition at line 143 of file neuroninterfaces.cpp.


Member Function Documentation

void defineBlock ( QString  name,
layer_t  layer,
int  startIndex,
int  size 
)

Define a block.

Parameters:
nameis the name to give to the block
layeris the layer on which the neurons lay
startIndexis the index of the neuron from which this block starts
sizeis the number of neurons for this block
Warning:
it will overwrite any previous block definition with the same name

Definition at line 155 of file neuroninterfaces.cpp.

Referenced by EvoRobotExperiment::recreateNeuralNetwork().

double getOutput ( ) [virtual]

Get the output of the current neuron.

Implements NeuronsIterator.

Definition at line 192 of file neuroninterfaces.cpp.

bool nextNeuron ( ) [virtual]

Go to the next neuron of the current block.

Returns:
true if a next neuron exist and set it as current neuron; false when it has been reached the end of current block
Note:
if you need to go back at the beginning, use setCurrentBlock again

Implements NeuronsIterator.

Definition at line 176 of file neuroninterfaces.cpp.

Referenced by HandObjectVisualOffsetSensor::update(), iCubPalmPatchesTouchSensor::update(), and iCubFingertipsTouchSensor::update().

bool setCurrentBlock ( QString  blockName) [virtual]

Set the current blocks of neurons to iterate.

You need to first call this method for iterate over neurons. This method will initialize the internal counters for iterate over neurons.

Note:
it's mandatory to configure the available blocks using the method defineBlock
Parameters:
blockNameis the name given to the block
Returns:
true if the current block is now the block defined with name blockName; false otherwise

Implements NeuronsIterator.

Definition at line 163 of file neuroninterfaces.cpp.

References Logger::error().

Referenced by HandObjectVisualOffsetSensor::update(), iCubPalmPatchesTouchSensor::update(), and iCubFingertipsTouchSensor::update().

void setEvonet ( Evonet evonet)

Set the Evonet on which iterate.

Warning:
when you set an Evonet all previous definition of blocks will be erased

Definition at line 147 of file neuroninterfaces.cpp.

Referenced by EvoRobotExperiment::recreateNeuralNetwork().

void setGraphicProperties ( QString  label,
double  minValue,
double  maxValue,
QColor  color 
) [virtual]

Set the graphic properties for the current neuron (in case it will be visualized on a GUI)

Parameters:
labelis the name to show on the GUI corresponding to current neuron
minValueis the min value for the current neuron (for the GUI visualizing the activation value)
maxValueis the max value for the current neuron (for the GUI visualizing the activation value)
coloris the color on which the above data will be displayed on the GUIs

Implements NeuronsIterator.

Definition at line 198 of file neuroninterfaces.cpp.

void setInput ( double  value) [virtual]

Set the input of the current neuron.

Implements NeuronsIterator.

Definition at line 186 of file neuroninterfaces.cpp.

Referenced by HandObjectVisualOffsetSensor::update(), iCubPalmPatchesTouchSensor::update(), and iCubFingertipsTouchSensor::update().


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