TarzaNN
TarzaNN neural network simulator
C:/Users/albertlr/projects/TarzaNN/TarzaNN/Layer.h
Go to the documentation of this file.
00001 /****************************************************************************
00002  **
00003  ** Copyright C 2002-2012 Laboratory for Active and Attentive Vision (LAAV), Department of Computer Science and Engineering, York University, Toronto, ON, Canada.
00004  ** All rights reserved.
00005  **
00006  ** This file is part of the TarzaNN Neural Network Simulator.
00007  **
00008  ** This file may be distributed and/or modified under the terms of the
00009  ** GNU General Public License version 2 as published by the Free Software
00010  ** Foundation and appearing in the file LICENSE.GPL included in the
00011  ** packaging of this file.
00012  **
00013  ** See http://www.tarzann.org/gpl/ for GPL licensing information.
00014  **
00015  ** Contact info@tarzann.org if any conditions of this licensing are
00016  ** not clear to you.
00017  **
00018  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00019  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00020  **
00021  ****************************************************************************/
00022 
00023 #ifndef LAYER_H_INCLUDED
00024 #define LAYER_H_INCLUDED
00025 
00026 #include <vector>
00027 #include <QString>
00028 #include "common.h"
00029 #include "Observer.h"
00030 
00031 class FeaturePlaneAbstract;
00032 class Matrix;
00033 
00034 using namespace std;
00035 
00036 class Layer: public Observer
00037 {
00038 public:
00039         Layer(QString name, int dirs, int scales, int type = LAYER_DEFAULT);
00040                 
00041         virtual ~Layer();
00042 
00043         virtual void updateNN(Observer* sourceFP, bool functional);
00044 
00045         int size(){
00046                 return _featurePlanes.size();
00047         }
00048 
00049         static int getType(const QString & name)
00050         {
00051                 int res = common::getType(&common::layerTypes,name);
00052                 return (res == -1) ? LAYER_DEFAULT: res;
00053         }
00054 
00055         void add(FeaturePlaneAbstract* toAdd){
00056                 _featurePlanes.push_back(toAdd);
00057         }
00058 
00059         vector<FeaturePlaneAbstract*>*  getFeaturePlanes(){
00060                 return & _featurePlanes;
00061         }
00062 
00063         QString Name() { return _name; }
00064         int Type() { return _type; }
00065         int Dirs()      { return _numberOfDirections; }
00066         int Scales() { return _numberOfScales; }
00067 
00068         void notify(int step);
00069         void notify(bool functional);
00070 
00071     Matrix* winners;
00072 
00073 protected:
00075     vector<FeaturePlaneAbstract*> _featurePlanes;
00076         QString _name;
00077         int _type;
00078         int _numberOfDirections;
00079         int _numberOfScales;
00080 };
00081 
00082 #endif //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines