23 #include "neuralnetiterator.h"
39 this->neuralnet = neuralnet;
45 neuralnet->byName( blockName, cluster );
48 Logger::error( QString(
"NeuralNetIterator - the block %1 does not exist").arg(blockName) );
56 checkCurrentStatus(
"nextNeuron" );
59 if ( currIndex >=
int(cluster->numNeurons()) ) {
66 checkCurrentStatus(
"setInput" );
68 cluster->setInput( currIndex, value );
72 checkCurrentStatus(
"getInput" );
74 return cluster->getInput( currIndex );
78 checkCurrentStatus(
"getOutput" );
79 return cluster->getOutput( currIndex );
83 checkCurrentStatus(
"setGraphicProperties" );
84 Logger::warning(
"NeuralNetIterator - it is not possible to set graphics properties for NeuralNet");
87 void NeuralNetIterator::checkCurrentStatus(
const QString& funcName )
const {
92 throw EvonetIteratorInvalidStatusException( funcName.toLatin1().data(),
"you should call setCurrentBlock first");
94 if ( currIndex >=
int(cluster->numNeurons()) ) {
95 throw EvonetIteratorInvalidStatusException( funcName.toLatin1().data(),
"attempt to access beyond the size of the current block");