public bool GenerateNewPopulation(List <GameObject> iOldPopulation) { oldPopulation.AddRange(iOldPopulation); //sort according to fitness FitnessComparer fintessComp = new FitnessComparer(); oldPopulation.Sort(fintessComp); newPopulation = new List <List <MovementRule> >(); Elitism(); SelectionChrom(); Replace(); ClearPopulation(); return(true); }
public List <Genome> GenerateNewPopulation(List <Genome> iOldPopulation) { ClearPopulation(); oldPopulation.AddRange(iOldPopulation); //sort according to fitness FitnessComparer fintessComp = new FitnessComparer(); oldPopulation.Sort(fintessComp); Elitism(); SelectionChrom(); Replace(); return(mGenomes); }