@Test public void testGetParents() { ESamplingSurvivorGeneration survivorGeneration = mock(ESamplingSurvivorGenerationBasic.class); EpsilonSamplingSelector selector = new EpsilonSamplingSelector(survivorGeneration); Individual first = mock(Individual.class); Individual second = mock(Individual.class); Individual third = mock(Individual.class); Population population = new Population(); population.add(first); population.add(second); population.add(third); Collection<Individual> parents = selector.getParents(3, population); assertEquals(population, parents); }
@Override public Collection<Individual> getParents(int mu, Collection<Individual> population) { return population; }
EpsilonSamplingSelector implements Selector { @Override public Collection<Individual> getParents(int mu, Collection<Individual> population) { return population; } }
EpsilonSamplingSelector implements Selector { @Override public Collection<Individual> getParents(int mu, Collection<Individual> population) { return population; } @Inject  EpsilonSamplingSelector(ESamplingSurvivorGeneration survivorGeneration); }
EpsilonSamplingSelector implements Selector { @Override public Collection<Individual> getParents(int mu, Collection<Individual> population) { return population; } @Inject  EpsilonSamplingSelector(ESamplingSurvivorGeneration survivorGeneration); @Override Collection<Individual> getParents(int mu, Collection<Individual> population); @Override Collection<Individual> getLames(int lambda, Collection<Individual> population); @Override void init(int maxsize); }
EpsilonSamplingSelector implements Selector { @Override public Collection<Individual> getParents(int mu, Collection<Individual> population) { return population; } @Inject  EpsilonSamplingSelector(ESamplingSurvivorGeneration survivorGeneration); @Override Collection<Individual> getParents(int mu, Collection<Individual> population); @Override Collection<Individual> getLames(int lambda, Collection<Individual> population); @Override void init(int maxsize);  }