Beispiel #1
0
 public SpNeuron(SpikeNet spikeNet)
     : base("SpNeuron")
 {
     Net         = spikeNet;
     Mode        = NeuronMode.Normal;
     Connections = new List <SpConnection>();
 }
Beispiel #2
0
        public SpInputNeuron(SpikeNet spikeNet)
            : base(spikeNet)
        {
            FireFrequency = -1;

            iConnections = new CastingList <IConnection>(Connections);
        }
Beispiel #3
0
        public override INeuralNet GetNeuralNet()
        {
            var neuralNet = new SpikeNet();

            neuralNet.ImprintGenome(this);

            return(neuralNet);
        }
Beispiel #4
0
        public void ImprintGene(SpConnectionGene gene, SpNeuron source, SpikeNet net)
        {
            SpNeuron target;

            if (gene.IsOutputConnection)
            {
                target = net.OutputNeurons[gene.Target];
            }
            else
            {
                target = net.HiddenNeurons[gene.Target];
            }

            Source = source;
            Target = target;

            Weight = gene.Strength.Value;
            Delay  = (int)Math.Round(gene.Delay.Value * MaxDelay, 0);
        }
Beispiel #5
0
 public SpOutputNeuron(SpikeNet spikeNet)
     : base(spikeNet)
 {
 }
Beispiel #6
0
        public static SpConnection GetConnectionFromGene(SpConnectionGene gene, SpNeuron source, SpikeNet net)
        {
            var connection = new SpConnection();

            connection.ImprintGene(gene, source, net);

            return(connection);
        }