NSGA2 extends MuPlusLambda<T> { @Override public ArrayList<Genotype<T>> selection(int numParents, ArrayList<Score<T>> scores) { return staticSelection(numParents, staticNSGA2Scores(scores)); } NSGA2(); @SuppressWarnings("unchecked")  NSGA2(boolean io);  NSGA2(SinglePopulationTask<T> task, int mu, boolean io); @Override ArrayList<Genotype<T>> generateChildren(int numChildren, ArrayList<Score<T>> parentScores); static ArrayList<Genotype<T>> generateNSGA2Children(int numChildren, NSGA2Score<T>[] scoresArray,
			int generation, boolean mating, double crossoverRate); NSGA2Score<T>[] getNSGA2Scores(ArrayList<Score<T>> scores); static NSGA2Score<T>[] staticNSGA2Scores(ArrayList<Score<T>> scores); @Override ArrayList<Genotype<T>> selection(int numParents, ArrayList<Score<T>> scores); static ArrayList<Genotype<T>> staticSelection(int numParents, NSGA2Score<T>[] scoresArray); static ArrayList<NSGA2Score<T>> getParetoFront(NSGA2Score<T>[] scores); static ArrayList<ArrayList<NSGA2Score<T>>> getParetoLayers(NSGA2Score<T>[] scores); @SuppressWarnings("unchecked") static ArrayList<Genotype<T>> cullCrossovers(Genotype<T> parent1, Genotype<T> parent2);  }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void testSelection() { ArrayList<Genotype> result0 = ea.selection(3, scores); assertTrue(ArrayUtil.setEquality(PopulationUtil.getGenotypeIds(PopulationUtil.addListGenotypeType(result0)), fronts.get(0))); ArrayList<Genotype> result1 = ea.selection(6, scores); fronts.get(1).addAll(fronts.get(0)); assertTrue(ArrayUtil.setEquality(PopulationUtil.getGenotypeIds(PopulationUtil.addListGenotypeType(result1)), fronts.get(1))); ArrayList<Genotype> result2 = ea.selection(9, scores); fronts.get(2).addAll(fronts.get(1)); assertTrue(ArrayUtil.setEquality(PopulationUtil.getGenotypeIds(PopulationUtil.addListGenotypeType(result2)), fronts.get(2))); }