Package ec.multiobjective.spea2
Class SPEA2Breeder
java.lang.Object
ec.Breeder
ec.simple.SimpleBreeder
ec.multiobjective.spea2.SPEA2Breeder
- All Implemented Interfaces:
Setup,Singleton,Serializable
This subclass of SimpleBreeder overrides the loadElites method to build an archive in the top elites[subpopnum]
of each subpopulation. It computes the sparsity metric, then constructs the archive.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWe use a state variable to make sure that the archive isn't built twice in a row. -
Field Summary
FieldsFields inherited from class ec.simple.SimpleBreeder
backupPopulation, clonePipelineAndPopulation, elite, eliteFrac, newIndividuals, P_CLONE_PIPELINE_AND_POPULATION, P_ELITE, P_ELITE_FRAC, P_REEVALUATE_ELITES, P_SEQUENTIAL_BREEDING, pool, reevaluateElitesFields inherited from class ec.Breeder
sequentialBreeding -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbreedPopulation(EvolutionState state) Use super's breeding, but also set our local state to record that breeding is complete.double[]protected voidloadElites(EvolutionState state, Population newpop) Extract the elite individuals from the current population and both place in newpop and replace the current population with the archive.intnumElites(EvolutionState state, int subpopulation) Return the number of individuals that we aim to see in the elitist archive.voidpostProcess(EvolutionState state) A hook to do final modifications as necessary to the population after breeding has concluded.voidsetup(EvolutionState state, Parameter base) Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.Methods inherited from class ec.simple.SimpleBreeder
breedPopChunk, breedPopChunkProduce, nextSubpopulationSize, shouldBreedSubpop, unmarkElitesEvaluated, usingElitism
-
Field Details
-
P_K
- See Also:
-
P_NORMALIZE
- See Also:
-
-
Constructor Details
-
SPEA2Breeder
public SPEA2Breeder()
-
-
Method Details
-
setup
Description copied from interface:SetupSets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.- Specified by:
setupin interfaceSetup- Overrides:
setupin classSimpleBreeder
-
breedPopulation
Use super's breeding, but also set our local state to record that breeding is complete.- Overrides:
breedPopulationin classSimpleBreeder
-
numElites
Return the number of individuals that we aim to see in the elitist archive. This can only be called after loadArchive() and before breedPopulation().- Overrides:
numElitesin classSimpleBreeder
-
loadElites
Extract the elite individuals from the current population and both place in newpop and replace the current population with the archive. We place the elites straight into the current population because breeding is the next thing that happens right after loadElites() is called, and SPEA breeds children from the elitist archive.- Overrides:
loadElitesin classSimpleBreeder
-
postProcess
Description copied from class:SimpleBreederA hook to do final modifications as necessary to the population after breeding has concluded. By default this does nothing, but multiobjective breeders, which temporarily replace the old population while it's being breeded, may use this to put the popuplation back again just in case statistics needs it.- Overrides:
postProcessin classSimpleBreeder
-
calculateDistancesFromIndividual
-