AForge.Genetic.EliteSelection.ApplySelection C# (CSharp) Метод

ApplySelection() публичный Метод

Apply selection to the specified population.
Filters specified population keeping only specified amount of best chromosomes.
public ApplySelection ( List chromosomes, int size ) : void
chromosomes List Population, which should be filtered.
size int The amount of chromosomes to keep.
Результат void
        public void ApplySelection( List<IChromosome> chromosomes, int size )
        {
            // sort chromosomes
            chromosomes.Sort( );

            // remove bad chromosomes
            chromosomes.RemoveRange( size, chromosomes.Count - size );
        }
    }