00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CHERRYMOYA_H
00019 #define CHERRYMOYA_H
00020
00021 using namespace std;
00022 #include <amygdala/genomehandler.h>
00023 #include <amygdala/neuron.h>
00024
00025 #include <pair.h>
00026
00031 class Cherrymoya : public GenomeHandler {
00032 public:
00036 Cherrymoya(unsigned int r);
00037 ~Cherrymoya();
00038
00039
00040 virtual void gene (string gene);
00041 virtual void startChromosome(int geneLength, int genes);
00042 virtual void finish();
00043
00045 virtual const int& getradius();
00047 Network* getNetwork();
00049 vector <AmIdInt> GetInputNeurons();
00051 vector <Neuron*> GetOutputNeurons();
00052
00053 private:
00056 float stepSize;
00057
00059 unsigned int N_chromosome;
00061 unsigned int N_gene;
00063 int radius;
00065 float dendriteRadius;
00066 float offset;
00068 float axonLengthFactor;
00069
00073 vector < vector < vector <pair <bool, Neuron *> > > > theCherrymoya;
00074
00075
00076
00077 vector < float* > skinSingularities;
00078
00079
00080 vector < pair < float, Neuron*> > inputNeurons;
00081
00082
00083 vector < pair < float, Neuron*> > outputNeurons;
00084
00085 LayerConstants layerConst;
00086 Layer *hiddenLayer;
00087 Layer *inputLayer;
00088 Layer *outputLayer;
00089
00090 unsigned int nId;
00091
00092 enum cherrymoyaPart { SKIN=1, IN, OUT };
00093 Network *net;
00095 unsigned int synapses;
00096
00097 protected:
00098 void BuildCherrymoya();
00100 void connectInputNeurons();
00102 void connectSkin();
00104 void connectMeat();
00106 void getFieldStrengthMeat(float *location, float *E);
00108 void getFieldStrengthSkin(float *location, float *E);
00114 void AxonConnector3D(Neuron *currentNeuron);
00122 void AxonConnectorSkin(Neuron *currentNeuron);
00123 };
00124
00125 #endif