@Test public void testSetup() { final SPEA2Breeder instance = new SPEA2Breeder(); instance.setup(state, BASE); state.population = getTestPopulation(); final Population newpop = state.population.emptyClone(); instance.loadElites(state, newpop); assertTrue(instance.usingElitism(0)); assertEquals(10, instance.numElites(state, 0)); }
public void setup(final EvolutionState state, final Parameter base) { super.setup(state, base); if (sequentialBreeding) state.output.fatal("SPEA2Breeder does not support sequential evaluation.", base.push(P_SEQUENTIAL_BREEDING)); if (!clonePipelineAndPopulation) state.output.fatal("clonePipelineAndPopulation must be true for SPEA2Breeder."); k = state.parameters.getIntWithDefault(base.push(P_K), null, NOT_SET); normalize = state.parameters.getBoolean(base.push(P_NORMALIZE), null, true); breedingState = BreedingState.BREEDING_COMPLETE; }
SPEA2Breeder extends SimpleBreeder { public void setup(final EvolutionState state, final Parameter base) { super.setup(state, base); if (sequentialBreeding) state.output.fatal("SPEA2Breeder does not support sequential evaluation.", base.push(P_SEQUENTIAL_BREEDING)); if (!clonePipelineAndPopulation) state.output.fatal("clonePipelineAndPopulation must be true for SPEA2Breeder."); k = state.parameters.getIntWithDefault(base.push(P_K), null, NOT_SET); normalize = state.parameters.getBoolean(base.push(P_NORMALIZE), null, true); breedingState = BreedingState.BREEDING_COMPLETE; } }
SPEA2Breeder extends SimpleBreeder { public void setup(final EvolutionState state, final Parameter base) { super.setup(state, base); if (sequentialBreeding) state.output.fatal("SPEA2Breeder does not support sequential evaluation.", base.push(P_SEQUENTIAL_BREEDING)); if (!clonePipelineAndPopulation) state.output.fatal("clonePipelineAndPopulation must be true for SPEA2Breeder."); k = state.parameters.getIntWithDefault(base.push(P_K), null, NOT_SET); normalize = state.parameters.getBoolean(base.push(P_NORMALIZE), null, true); breedingState = BreedingState.BREEDING_COMPLETE; }  }
SPEA2Breeder extends SimpleBreeder { public void setup(final EvolutionState state, final Parameter base) { super.setup(state, base); if (sequentialBreeding) state.output.fatal("SPEA2Breeder does not support sequential evaluation.", base.push(P_SEQUENTIAL_BREEDING)); if (!clonePipelineAndPopulation) state.output.fatal("clonePipelineAndPopulation must be true for SPEA2Breeder."); k = state.parameters.getIntWithDefault(base.push(P_K), null, NOT_SET); normalize = state.parameters.getBoolean(base.push(P_NORMALIZE), null, true); breedingState = BreedingState.BREEDING_COMPLETE; }  void setup(final EvolutionState state, final Parameter base); Population breedPopulation(EvolutionState state); @Override int numElites(EvolutionState state, int subpopulation); @Override void postProcess(EvolutionState state); double[] calculateDistancesFromIndividual(Individual ind, ArrayList<Individual> inds); }
SPEA2Breeder extends SimpleBreeder { public void setup(final EvolutionState state, final Parameter base) { super.setup(state, base); if (sequentialBreeding) state.output.fatal("SPEA2Breeder does not support sequential evaluation.", base.push(P_SEQUENTIAL_BREEDING)); if (!clonePipelineAndPopulation) state.output.fatal("clonePipelineAndPopulation must be true for SPEA2Breeder."); k = state.parameters.getIntWithDefault(base.push(P_K), null, NOT_SET); normalize = state.parameters.getBoolean(base.push(P_NORMALIZE), null, true); breedingState = BreedingState.BREEDING_COMPLETE; }  void setup(final EvolutionState state, final Parameter base); Population breedPopulation(EvolutionState state); @Override int numElites(EvolutionState state, int subpopulation); @Override void postProcess(EvolutionState state); double[] calculateDistancesFromIndividual(Individual ind, ArrayList<Individual> inds); final static String P_K; final static String P_NORMALIZE; }