ec.simple
Class SimpleBreeder
java.lang.Object
|
+--ec.Breeder
|
+--ec.simple.SimpleBreeder
- 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) |
- 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
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
P_ELITE
public static final java.lang.String P_ELITE
elite
public int[] elite
- An array[subpop] of the number of elites to keep for that subpopulation
SimpleBreeder
public SimpleBreeder()
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)
throws java.lang.CloneNotSupportedException
- 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.
- Overrides:
- breedPopulation in class Breeder
breedPopChunk
public void breedPopChunk(Population newpop,
EvolutionState state,
int[] numinds,
int[] from,
int threadnum)
throws java.lang.CloneNotSupportedException
- 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.