Ejemplo n.º 1
0
        // Makes selection on the current population and updates the average fitness and convergence.
        private void MakeSelection()
        {
            CurrentPopulation.MakeSelection(GeneticSettings.Selector, GeneticSettings.SelectionSize, GeneticSettings.RandomNumberGenerator);
            double totalFitness = 0;

            for (int i = 0; i < CurrentPopulation.Agents.Count; i++)
            {
                totalFitness += CurrentPopulation.Agents[i].Fitness;
            }
            CurrentAverageFitnessSelection = totalFitness / CurrentPopulation.Agents.Count;
            ConvergencePercent             = CurrentPopulation.GetConvergencePercent();
        }