• Main Page
  • Modules
  • Classes
  • Files
  • File List

D:/Projekt/ECF_trunk/examples/GPNN/EvalOp.h

00001 #ifndef EvalOp_h
00002 #define EvalOp_h
00003 
00004 
00005 class EvalOp : public EvaluateOp
00006 {
00007 public:
00008     FitnessP evaluate(IndividualP individual);
00009     bool initialize(StateP);
00010     void registerParameters(StateP);
00011 
00012     StateP state_;
00013 };
00014 typedef boost::shared_ptr<EvalOp> EvalOpP;
00015 
00016 
00017 
00018 // a simple neuron class (holds the weights and other neuron data)
00019 class Neuron
00020 {
00021 public:
00022     double weight[3][3];
00023     double potential;
00024     double fireProbability;
00025     double state, previousState;
00026 };
00027 
00028 
00029 // a class that simulates the network
00030 class Network
00031 {
00032 public:
00033     // general data:
00034     std::vector< std::vector<Neuron> > neurons;  // neurons in the network
00035     uint netSize;                                // network size (length of a 2D neuron array)
00036     uint nEvaluations;                           // number of network error calculations in simulated optimization
00037 
00038     // simulation & learning data:
00039     Tree::Tree* learningTree;                    // current tree
00040     double newError, oldError, minError;
00041 
00042     // general functions:
00043     Network();
00044     void initialize(StateP);
00045     double learnNumberOfIterations();
00046     double calculateError();
00047 
00048     // tree functions (called from within a GP tree):
00049     bool ifBetter()
00050     {
00051         if(newError < oldError)
00052             return true;
00053         return false;
00054     }
00055 };
00056 
00057 #endif 

Generated on Fri Jul 5 2013 09:34:24 for ECF by  doxygen 1.7.1