00001 # ifndef LAYER_H 00002 # define LAYER_H 00003 00004 # include <neuron.h> 00005 # include <list> 00006 # include <qmessagebox.h> 00007 # include <iostream> 00008 # include <qglviewer.h> 00009 00010 using namespace std ; 00011 using namespace qglviewer ; 00012 00013 class Layer { 00014 private: 00015 list<Neuron*> *neurons; 00016 int id; 00017 ManipulatedFrame * frame_ ; 00018 00019 public: 00020 Layer(int _id); 00021 00025 int getId(); 00026 list<Neuron*>* getNeurons(); 00027 int getNum() ; 00028 Neuron* getNeuronFromId(int id_neur); 00029 00033 void draw( int selected, const bool names = false ) ; 00034 void drawNeurons( int selected, const bool names = false ) ; 00035 void drawLayer( const bool names = false ) ; 00036 ManipulatedFrame * frame( int id ) ; 00037 00041 int nbNeurons(); 00042 void addNeuron(int id); 00043 void addNeuron(int id, float x, float z); 00044 void removeNeuron(int id); 00045 void removeNeurons(); 00046 bool existNeuron(int id); 00047 void setNeuronsLinePos( int n, list<Neuron*>::iterator *iter, float z ); 00048 void updateNeuronsPos( void ) ; 00049 00053 void clearAxons(); 00054 00058 void resetAllValues(); 00059 void resetTempValues(); 00060 void forwardPropagation(); 00061 void gradientBackPropagation(); 00062 00066 void description(); 00067 }; 00068 00069 # endif