@Test public void testSetup() { final ProportionateComponentSelector instance = new ProportionateComponentSelector(); instance.setup(state, BASE); assertEquals(0.5, instance.getAlpha(), 0.00001); assertEquals(0.6, instance.getBeta(), 0.00001); assertTrue(instance.repOK()); }
@Override public void setup(final EvolutionState state, final Parameter base) { assert(state != null); assert(base != null); alpha = state.parameters.getDouble(base.push(P_ALPHA), null, 0); beta = state.parameters.getDouble(base.push(P_BETA), null, 0); assert(repOK()); }
ProportionateComponentSelector implements ComponentSelector, Setup { @Override public void setup(final EvolutionState state, final Parameter base) { assert(state != null); assert(base != null); alpha = state.parameters.getDouble(base.push(P_ALPHA), null, 0); beta = state.parameters.getDouble(base.push(P_BETA), null, 0); assert(repOK()); } }
ProportionateComponentSelector implements ComponentSelector, Setup { @Override public void setup(final EvolutionState state, final Parameter base) { assert(state != null); assert(base != null); alpha = state.parameters.getDouble(base.push(P_ALPHA), null, 0); beta = state.parameters.getDouble(base.push(P_BETA), null, 0); assert(repOK()); } ProportionateComponentSelector();  ProportionateComponentSelector(final double alpha, final double beta); }
ProportionateComponentSelector implements ComponentSelector, Setup { @Override public void setup(final EvolutionState state, final Parameter base) { assert(state != null); assert(base != null); alpha = state.parameters.getDouble(base.push(P_ALPHA), null, 0); beta = state.parameters.getDouble(base.push(P_BETA), null, 0); assert(repOK()); } ProportionateComponentSelector();  ProportionateComponentSelector(final double alpha, final double beta); double getAlpha(); double getBeta(); @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); final boolean repOK(); }
ProportionateComponentSelector implements ComponentSelector, Setup { @Override public void setup(final EvolutionState state, final Parameter base) { assert(state != null); assert(base != null); alpha = state.parameters.getDouble(base.push(P_ALPHA), null, 0); beta = state.parameters.getDouble(base.push(P_BETA), null, 0); assert(repOK()); } ProportionateComponentSelector();  ProportionateComponentSelector(final double alpha, final double beta); double getAlpha(); double getBeta(); @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); final boolean repOK(); final static String P_ALPHA; final static String P_BETA; }