public static SpConnection GetConnectionFromGene(SpConnectionGene gene, SpNeuron source, SpikeNet net) { var connection = new SpConnection(); connection.ImprintGene(gene, source, net); return(connection); }
public Spike(SpNeuron source, SpConnection connection) { Source = source; Target = connection.Target; Connection = connection; Strength = connection.Weight; CyclesToImpact = connection.Delay; }
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); }