AForge.Genetic.Population.Regenerate C# (CSharp) Метод

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

Regenerate population.
The method regenerates population filling it with random chromosomes.
public Regenerate ( ) : void
Результат void
        public void Regenerate( )
        {
            IChromosome ancestor = population[0];

            // clear population
            population.Clear( );
            // add chromosomes to the population
            for ( int i = 0; i < size; i++ )
            {
                // create new chromosome
                IChromosome c = ancestor.CreateNew( );
                // calculate it's fitness
                c.Evaluate( fitnessFunction );
                // add it to population
                population.Add( c );
            }
        }