ec.simple
Class SimpleBreeder

java.lang.Object
  extended by ec.Breeder
      extended by ec.simple.SimpleBreeder
All Implemented Interfaces:
Setup, Singleton, java.io.Serializable
Direct Known Subclasses:
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.

Parameters

base.elite.i
int >= 0 (default=0)
(the number of elitist individuals for subpopulation i)

Version:
1.0
Author:
Sean Luke
See Also:
Serialized Form

Field Summary
 int[] elite
          An array[subpop] of the number of elites to keep for that subpopulation
static java.lang.String P_ELITE
           
 
Constructor Summary
SimpleBreeder()
           
 
Method Summary
 void breedPopChunk(Population newpop, EvolutionState state, int[] numinds, int[] from, int threadnum)
          A private helper function for breedPopulation which breeds a chunk of individuals in a subpopulation for a given thread.
 Population breedPopulation(EvolutionState state)
          A simple breeder that doesn't attempt to do any cross- population breeding.
 void loadElites(EvolutionState state, Population newpop)
          A private helper function for breedPopulation which loads elites into a subpopulation.
 void setup(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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_ELITE

public static final java.lang.String P_ELITE
See Also:
Constant Field Values

elite

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

Constructor Detail

SimpleBreeder

public SimpleBreeder()
Method Detail

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.


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

breedPopChunk

public void breedPopChunk(Population newpop,
                          EvolutionState state,
                          int[] numinds,
                          int[] from,
                          int threadnum)
A private helper function for breedPopulation which breeds a chunk of individuals in a subpopulation for a given thread. Although this method is declared public (for the benefit of a private helper class in this file), you should not call it.


loadElites

public void loadElites(EvolutionState state,
                       Population newpop)
A private helper function for breedPopulation which loads elites into a subpopulation.