TarzaNN
TarzaNN neural network simulator
C:/Users/albertlr/projects/TarzaNN/TarzaNN/ConstantInputFeaturePlane.h
Go to the documentation of this file.
00001 #ifndef CONSTANTINPUTFEATUREPLANE_H_INCLUDED
00002 #define CONSTANTINPUTFEATUREPLANE_H_INCLUDED
00003 
00004 #include "nowarn.h"
00005 #include "common.h"
00006 #include <stdlib.h>
00007 
00008 #include "OutputImage.h"
00009 #include "InputFeaturePlaneAbstract.h"
00010 
00012 class ConstantInputFeaturePlane : public InputFeaturePlaneAbstract {
00013         friend class FeaturePlaneFactory;
00014 public:
00015     ~ConstantInputFeaturePlane() {
00016         delete currentOutput;
00017     }
00018         
00019 protected:
00022         ConstantInputFeaturePlane( Network* net, int l, float val, int w, int h, QString* nameIn, bool isWTA, bool visible, NotifyStrategyAbstract* notify):InputFeaturePlaneAbstract( net, l, nameIn, isWTA, visible, notify){
00023                 width=w;
00024                 height=h;
00025                 outputValue=val;
00026         fpType = FP_INPUT_CONST;
00027                 should_show=visible;
00028         setName(new QString(4));
00029                 currentOutput = new OutputImage(width, height, fpID);
00030                 currentOutputList = NULL;
00031                 workOutputList = NULL;    
00032                 outputHistoryList = NULL;
00033                 
00034                 localAccess.lock();
00035                 
00036                 for(int i=0; i<width; i++){
00037                         for(int j=0; j<height; j++) {
00038                                 (*currentOutput)(i,j) = outputValue;
00039                         }
00040                 }
00041                 
00042                 localAccess.unlock();
00043         };
00044 private:
00045         float outputValue;
00046 };
00047 #endif //CONSTANTINPUTFEATUREPLANE_H_INCLUDED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines