public PulseNeuron(PulseBrain brain, PulseNeuron cloneme) { ActivationEnergy = cloneme.ActivationEnergy; EnergyDecay = cloneme.EnergyDecay; connections = new List <Connection>(cloneme.connections.Count); Neuron_Id = cloneme.Neuron_Id; }
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)); } }
public PulseBrain(PulseBrain clone) { Inputs = new List <PulseNeuron>(clone.Inputs.Count); noninputs = new List <List <PulseNeuron> >(clone.noninputs.Count); for (int i = 0; i < clone.Inputs.Count; i++) { Inputs.Add(new PulseNeuron(this, clone.Inputs[i])); } for (int l = 0; l < clone.noninputs.Count; l++) { noninputs.Add(new List <PulseNeuron>(clone.noninputs[l].Count)); for (int i = 0; i < clone.noninputs[l].Count; i++) { noninputs[l].Add(new PulseNeuron(this, clone.noninputs[l][i])); } } for (int i = 0; i < clone.Inputs.Count; i++) { Inputs[i].CloneConnections(this, clone.Inputs[i]); } for (int l = 0; l < clone.noninputs.Count; l++) { for (int i = 0; i < clone.noninputs[l].Count; i++) { noninputs[l][i].CloneConnections(this, clone.noninputs[l][i]); } } M_NeuronID = clone.M_NeuronID; }