Encog.Neural.Networks.Training.NEAT.NEATGenome.IsDuplicateLink C# (CSharp) Method

IsDuplicateLink() public method

Determine if this is a duplicate link.
public IsDuplicateLink ( long fromNeuronID, long toNeuronID ) : bool
fromNeuronID long The from neuron id.
toNeuronID long The to neuron id.
return bool
        public bool IsDuplicateLink(long fromNeuronID, long toNeuronID)
        {
            foreach (IGene gene in this.Links.Genes)
            {
                NEATLinkGene linkGene = (NEATLinkGene)gene;
                if ((linkGene.FromNeuronID == fromNeuronID)
                        && (linkGene.ToNeuronID == toNeuronID))
                {
                    return true;
                }
            }

            return false;
        }