AForge.Genetic.ExtendedGeneFunction.Clone C# (CSharp) Method

Clone() public method

Clone the gene.

The method clones the chromosome returning the exact copy of it.

public Clone ( ) : IGPGene
return IGPGene
        public IGPGene Clone( )
        {
            // create new gene ...
            ExtendedGeneFunction clone = new ExtendedGeneFunction( variablesCount, false );
            // ... with the same type and value
            clone.type = type;
            clone.val  = val;
            clone.argumentsCount = argumentsCount;

            return clone;
        }