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 );
        }
    }