private void AddEliteFromPreviousGeneration(List <Individual> elitisms) { if (Elitism > 0) { var worstIndividuals = Individuals.OrderBy(s => s.Fitness).Take(Elitism).ToList(); for (var i = 0; i < elitisms.Count; i++) { var index = Individuals.IndexOf(Individuals.Where(s => s.Fitness == worstIndividuals[i].Fitness).FirstOrDefault()); Individuals[index] = elitisms[i]; } } }