Documentation of 'ec.simple.SimpleBreeder' Java class
SimpleBreeder
ec.simple

Class SimpleBreeder

  • All Implemented Interfaces:
    Setup, Singleton, java.io.Serializable
    Direct Known Subclasses:
    NSGA2Breeder, SpatialBreeder, SPEA2Breeder, SteadyStateBreeder


    public class SimpleBreeder
    extends Breeder
    Breeds each subpopulation separately, with no inter-population exchange, and using a generational approach. A SimpleBreeder may have multiple threads; it divvys up a subpopulation into chunks and hands one chunk to each thread to populate. One array of BreedingPipelines is obtained from a population's Species for each operating breeding thread.

    Prior to breeding a subpopulation, a SimpleBreeder may first fill part of the new subpopulation up with the best n individuals from the old subpopulation. By default, n is 0 for each subpopulation (that is, this "elitism" is not done). The elitist step is performed by a single thread.

    If the sequential parameter below is true, then breeding is done specially: instead of breeding all Subpopulations each generation, we only breed one each generation. The subpopulation index to breed is determined by taking the generation number, modulo the total number of subpopulations. Use of this parameter outside of a coevolutionary context (see ec.coevolve.MultiPopCoevolutionaryEvaluator) is very rare indeed.

    SimpleBreeder adheres to the default-subpop parameter in Population: if either an 'elite' or 'reevaluate-elites' parameter is missing, it will use the default subpopulation's value and signal a warning.

    Parameters

    base.elite.i
    int >= 0 (default=0)
    (the number of elitist individuals for subpopulation i)
    base.reevaluate-elites.i
    boolean (default = false)
    (should we reevaluate the elites of subpopulation i each generation?)
    base.sequential
    boolean (default = false)
    (should we breed just one subpopulation each generation (as opposed to all of them)?)
    See Also:
    Serialized Form
    • Field Detail

      • P_REEVALUATE_ELITES

        public static final java.lang.String P_REEVALUATE_ELITES
        See Also:
        Constant Field Values
      • P_SEQUENTIAL_BREEDING

        public static final java.lang.String P_SEQUENTIAL_BREEDING
        See Also:
        Constant Field Values
      • P_CLONE_PIPELINE_AND_POPULATION

        public static final java.lang.String P_CLONE_PIPELINE_AND_POPULATION
        See Also:
        Constant Field Values
      • elite

        public int[] elite
        An array[subpop] of the number of elites to keep for that subpopulation
      • eliteFrac

        public double[] eliteFrac
      • reevaluateElites

        public boolean[] reevaluateElites
      • sequentialBreeding

        public boolean sequentialBreeding
      • clonePipelineAndPopulation

        public boolean clonePipelineAndPopulation
      • backupPopulation

        public Population backupPopulation
    • Constructor Detail

      • SimpleBreeder

        public SimpleBreeder()
    • Method Detail

      • usingElitism

        public boolean usingElitism(int subpopulation)
      • numElites

        public int numElites(EvolutionState state,
                             int subpopulation)
      • 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.
      • computeSubpopulationLength

        public int computeSubpopulationLength(EvolutionState state,
                                              Population newpop,
                                              int subpopulation,
                                              int threadnum)
        Elites are often stored in the top part of the subpopulation; this function returns what part of the subpopulation contains individuals to replace with newly-bred ones (up to but not including the elites).
      • breedPopulation

        public Population breedPopulation(EvolutionState state)
        A simple breeder that doesn't attempt to do any cross- population breeding. Basically it applies pipelines, one per thread, to various subchunks of a new population.
        Specified by:
        breedPopulation in class Breeder
      • shouldBreedSubpop

        public boolean shouldBreedSubpop(EvolutionState state,
                                         int subpop,
                                         int threadnum)
        Returns true if we're doing sequential breeding and it's the subpopulation's turn (round robin, one subpopulation per generation).

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.