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

Inheritance diagram for EvonetIterator:

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.
 
EvonetgetEvonet ()
 Return the Evonet on which it will iterate on.
 
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.
 
- Public Member Functions inherited from NeuronsIterator
virtual ~NeuronsIterator ()
 Destructor.
 

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 221 of file neuroninterfaces.h.

Member Enumeration Documentation

enum layer_t

enum the possible layers on which the blocks can be defined

Definition at line 234 of file neuroninterfaces.h.

Constructor & Destructor Documentation

Constructor.

Definition at line 150 of file neuroninterfaces.cpp.

~EvonetIterator ( )
virtual

Destructor.

Definition at line 159 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 175 of file neuroninterfaces.cpp.

Evonet * getEvonet ( )

Return the Evonet on which it will iterate on.

Definition at line 171 of file neuroninterfaces.cpp.

double getOutput ( )
virtual

Get the output of the current neuron.

Implements NeuronsIterator.

Definition at line 212 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 196 of file neuroninterfaces.cpp.

Referenced by iCubFingertipsTouchSensor::update(), iCubPalmPatchesTouchSensor::update(), and HandObjectVisualOffsetSensor::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 183 of file neuroninterfaces.cpp.

References Logger::error().

Referenced by iCubFingertipsTouchSensor::update(), iCubPalmPatchesTouchSensor::update(), and HandObjectVisualOffsetSensor::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 163 of file neuroninterfaces.cpp.

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 218 of file neuroninterfaces.cpp.

void setInput ( double  value)
virtual

Set the input of the current neuron.

Implements NeuronsIterator.

Definition at line 206 of file neuroninterfaces.cpp.

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


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