Package ec.multiobjective.nsga2
Class NSGA2Breeder
java.lang.Object
ec.Breeder
ec.simple.SimpleBreeder
ec.multiobjective.nsga2.NSGA2Breeder
- All Implemented Interfaces:
Setup,Singleton,Serializable
This SimpleBreeder subclass breeds a set of children from the Population, then
joins the original Population with the children in a (mu+mu) fashion. An NSGA2Breeder
may have multiple threads for breeding.
NSGA-II has fixed archive size (the population size), and so ignores the 'elites' declaration. However it will adhere to the 'reevaluate-elites' parameter in SimpleBreeder to determine whether to force fitness reevaluation.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWe use a state variable to make sure that the nextSubpopulationSize() method is only called at the appropriate time. -
Field Summary
Fields inherited from class ec.simple.SimpleBreeder
backupPopulation, clonePipelineAndPopulation, elite, eliteFrac, newIndividuals, NOT_SET, 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 TypeMethodDescriptionassignFrontRanks(Subpopulation subpop) Divides inds into ranks and assigns each individual's rank to be the rank it was placed into.breedPopulation(EvolutionState state) Use super's breeding, but also set our local state to record that breeding is complete.buildArchive(EvolutionState state, int subpop) Build the auxiliary fitness data and reduce the subpopulation to just the archive, which is returned.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) 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
-
Constructor Details
-
NSGA2Breeder
public NSGA2Breeder()
-
-
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
-
numElites
- 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 NSGA-II 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
-
breedPopulation
Use super's breeding, but also set our local state to record that breeding is complete.- Overrides:
breedPopulationin classSimpleBreeder
-
buildArchive
Build the auxiliary fitness data and reduce the subpopulation to just the archive, which is returned. -
assignFrontRanks
Divides inds into ranks and assigns each individual's rank to be the rank it was placed into. Each front is an ArrayList.
-