Class NSGA2Breeder

java.lang.Object
ec.Breeder
ec.simple.SimpleBreeder
ec.multiobjective.nsga2.NSGA2Breeder
All Implemented Interfaces:
Setup, Singleton, Serializable

public class NSGA2Breeder extends SimpleBreeder
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:
  • Constructor Details

    • NSGA2Breeder

      public NSGA2Breeder()
  • Method Details

    • setup

      public void setup(EvolutionState state, Parameter base)
      Description copied from interface: Setup
      Sets 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:
      setup in interface Setup
      Overrides:
      setup in class SimpleBreeder
    • numElites

      public int numElites(EvolutionState state, int subpopulation)
      Overrides:
      numElites in class SimpleBreeder
    • loadElites

      protected void loadElites(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. 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:
      loadElites in class SimpleBreeder
    • postProcess

      public void postProcess(EvolutionState state)
      Description copied from class: SimpleBreeder
      A 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:
      postProcess in class SimpleBreeder
    • breedPopulation

      public Population breedPopulation(EvolutionState state)
      Use super's breeding, but also set our local state to record that breeding is complete.
      Overrides:
      breedPopulation in class SimpleBreeder
    • buildArchive

      public ArrayList<Individual> buildArchive(EvolutionState state, int subpop)
      Build the auxiliary fitness data and reduce the subpopulation to just the archive, which is returned.
    • assignFrontRanks

      public ArrayList<ArrayList<Individual>> assignFrontRanks(Subpopulation subpop)
      Divides inds into ranks and assigns each individual's rank to be the rank it was placed into. Each front is an ArrayList.