23 #ifndef NEURONINTERFACES_H
24 #define NEURONINTERFACES_H
27 #include "resourcesuser.h"
28 #include "parametersettable.h"
29 #include "baseexception.h"
38 #pragma warning(disable:4996)
68 virtual bool setCurrentBlock( QString blockName ) = 0;
74 virtual bool nextNeuron() = 0;
76 virtual void setInput(
double value ) = 0;
78 virtual double getOutput() = 0;
85 virtual void setGraphicProperties( QString label,
double minValue,
double maxValue, QColor color ) = 0;
112 static void describe( QString type );
118 void setName( QString name );
120 virtual void update() = 0;
126 virtual int size() = 0;
131 void checkAllNeededResourcesExist();
135 void resetNeededResourcesCheck();
140 QString actualResourceNameForMultirobot(QString resourceName)
const;
143 bool allNeededResourcesExist;
148 QString resourcePrefix;
175 static void describe( QString type );
181 void setName( QString name );
183 virtual void update() = 0;
189 virtual int size() = 0;
194 void checkAllNeededResourcesExist();
198 void resetNeededResourcesCheck();
203 QString actualResourceNameForMultirobot(QString resourceName)
const;
206 bool allNeededResourcesExist;
211 QString resourcePrefix;
230 void setEvonet(
Evonet* evonet );
234 typedef enum { InputLayer, HiddenLayer, OutputLayer } layer_t;
242 void defineBlock( QString name, layer_t layer,
int startIndex,
int size );
253 bool setCurrentBlock( QString blockName );
261 void setInput(
double value );
270 void setGraphicProperties( QString label,
double minValue,
double maxValue, QColor color );
277 void checkCurrentStatus(
const QString& funcName = QString() )
const;
286 QMap<QString, BlockInfo> blocks;
320 strncpy(m_function,
function, 256);
321 m_function[255] =
'\0';
322 strncpy(m_reason, reason, 256);
323 m_reason[255] =
'\0';
324 sprintf(m_errorMessage,
"Invalid status for EvonetItarator in function \"%s\", reason: %s", m_function, m_reason);
325 m_errorMessage[1023] =
'\0';
336 strncpy(m_function, other.m_function, 256);
337 m_function[255] =
'\0';
338 strncpy(m_reason, other.m_reason, 256);
339 m_reason[255] =
'\0';
340 strncpy(m_errorMessage, other.m_errorMessage, 1024);
341 m_errorMessage[1023] =
'\0';
351 if (&other ==
this) {
355 BaseException::operator=(other);
356 strncpy(m_function, other.m_function, 256);
357 m_function[255] =
'\0';
358 strncpy(m_reason, other.m_reason, 256);
359 m_reason[255] =
'\0';
360 strncpy(m_errorMessage, other.m_errorMessage, 1024);
361 m_errorMessage[1023] =
'\0';
378 virtual const char *what()
const throw()
380 return m_errorMessage;
388 const char *
function()
const throw()
399 const char *reason()
const throw()
414 char m_function[256];
424 char m_errorMessage[1024];
430 #if defined(_MSC_VER)