예제 #1
0
        public static SpConnection GetConnectionFromGene(SpConnectionGene gene, SpNeuron source, SpikeNet net)
        {
            var connection = new SpConnection();

            connection.ImprintGene(gene, source, net);

            return(connection);
        }
예제 #2
0
 public Spike(SpNeuron source, SpConnection connection)
 {
     Source         = source;
     Target         = connection.Target;
     Connection     = connection;
     Strength       = connection.Weight;
     CyclesToImpact = connection.Delay;
 }
예제 #3
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);
        }