Esempio n. 1
0
 public void CloneConnections(PulseBrain brain, PulseNeuron cloneme)
 {
     foreach (Connection c in cloneme.connections)
     {
         connections.Add(new Connection(brain.getNeuron(c.target.Neuron_Id), c.amt));
     }
 }
Esempio n. 2
0
 public PulseNeuron(PulseBrain brain, PulseNeuron cloneme)
 {
     ActivationEnergy = cloneme.ActivationEnergy;
     EnergyDecay      = cloneme.EnergyDecay;
     connections      = new List <Connection>(cloneme.connections.Count);
     Neuron_Id        = cloneme.Neuron_Id;
 }
Esempio n. 3
0
        public void Mutate(double aeAdjust, double elAdjust, double cAdjust, int mCV)
        {
            PulseNeuron target = getNeuron(GlobalRandom.random.Next(M_NeuronID));

            target.ActivationEnergy += GlobalRandom.NextBetween(-aeAdjust, aeAdjust);
            if (target.ActivationEnergy < 0)
            {
                target.ActivationEnergy = 0;
            }
            target.EnergyDecay += GlobalRandom.NextBetween(-elAdjust, elAdjust);
            if (target.EnergyDecay < 0)
            {
                target.EnergyDecay = 0;
            }
            if (target.connections.Count > 0)
            {
                Connection adjc = target.connections[GlobalRandom.random.Next(target.connections.Count)];
                adjc.amt += GlobalRandom.NextBetween(-cAdjust, cAdjust);
                adjc.amt  = MathHelper.Clamp((float)adjc.amt, -mCV, mCV);
            }
        }
Esempio n. 4
0
 public void AddConnection(PulseNeuron neuron, double amt)
 {
     connections.Add(new Connection(neuron, amt));
 }
Esempio n. 5
0
 public Connection(PulseNeuron n, double v)
 {
     target = n;
     amt    = v;
 }