00001 # include <learningThread.h> 00002 00003 void LearningThread::run() { 00004 network->learning(filename, errorThreshold, maxNbEpoch, convergenceCoeff); 00005 } 00006 00007 void LearningThread::init(QString f, double eT, int maxNE, double convCoeff) { 00008 filename = f; 00009 errorThreshold= eT; 00010 maxNbEpoch = maxNE; 00011 convergenceCoeff = convCoeff; 00012 } 00013 00014 int LearningThread::getState() { 00015 return state; 00016 } 00017 00018 void LearningThread::setState(int s) { 00019 state = s; 00020 } 00021 00022 void LearningThread::uwait(unsigned long t) { 00023 while (state == PAUSE) { 00024 QThread::usleep(t); 00025 } 00026 if (state == STEP) QThread::usleep(100000); 00027 else QThread::usleep(t); 00028 } 00029 00030 void LearningThread::nextStep() { 00031 state = STEP; 00032 }