Class SPEA2Breeder

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

public class SPEA2Breeder extends SimpleBreeder
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:
  • Field Details

  • Constructor Details

    • SPEA2Breeder

      public SPEA2Breeder()
  • 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
    • 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
    • numElites

      public int numElites(EvolutionState state, int subpopulation)
      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:
      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 SPEA 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
    • calculateDistancesFromIndividual

      public double[] calculateDistancesFromIndividual(Individual ind, ArrayList<Individual> inds)