public final Population nextGeneration(){
  calculateCumulativeRelativeFitnesses();
  int popSize=population.size();
  List<Genome> nextPopulation=new ArrayList<Genome>();
  for (int i=0; i < popSize; i++) {
    Genome parent=population.get(pickParent());
    nextPopulation.add(parent.replicate(mutator,fitnessFunction));
  }
  Population p=new Population(nextPopulation,mutator,fitnessFunction);
  return p;
}

public final Population nextGeneration ( ) { calculateCumulativeRelativeFitnesses ( ) ; int popSize = population . size ( ) ; List < Genome > nextPopulation = new ArrayList < Genome > ( ) ; for ( int i = 0 ; i < popSize ; i ++ ) { Genome parent = population . get ( pickParent ( ) ) ; nextPopulation . add ( parent . replicate ( mutator , fitnessFunction ) ) ; } Population p = new Population ( nextPopulation , mutator , fitnessFunction ) ; return p ; }
this function returns the next generation !
