PseudorandomProportionateComponentSelector implements ComponentSelector, Setup { @Override public void setup(final EvolutionState state, final Parameter base) { assert(base != null); probBest = state.parameters.getDouble(base.push(P_PROB_BEST), null, 0); proportionateSelector = new ProportionateComponentSelector(); proportionateSelector.setup(state, base); assert(repOK()); }  double getProbBest(); @Override void setup(final EvolutionState state, final Parameter base); @Override Component choose(final EvolutionState state, final List<Component> components, final PheromoneTable pheromones, final int thread); @Override boolean equals(final Object o); @Override int hashCode(); final boolean repOK(); final static String P_PROB_BEST; }
@Test public void testSetup() { final PseudorandomProportionateComponentSelector instance = new PseudorandomProportionateComponentSelector(); instance.setup(state, BASE); assertEquals(0.3, instance.getProbBest(), 0.000001); assertTrue(instance.repOK()); }