|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectec.Breeder
ec.simple.SimpleBreeder
public class SimpleBreeder
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) |
| base.reevalate-elites.i boolean (default = false) |
(should we reevaluate the elites of subpopulation i each generation?) |
| Field Summary | |
|---|---|
int[] |
elite
An array[subpop] of the number of elites to keep for that subpopulation |
static java.lang.String |
P_ELITE
|
static java.lang.String |
P_REEVALUATE_ELITES
|
boolean[] |
reevaluateElites
|
| Constructor Summary | |
|---|---|
SimpleBreeder()
|
|
| Method Summary | |
|---|---|
protected 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. |
int |
computeSubpopulationLength(Population newpop,
int subpopulation)
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). |
protected 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. |
protected void |
unmarkElitesEvaluated(Population newpop)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String P_ELITE
public static final java.lang.String P_REEVALUATE_ELITES
public int[] elite
public boolean[] reevaluateElites
| Constructor Detail |
|---|
public SimpleBreeder()
| Method Detail |
|---|
public void setup(EvolutionState state,
Parameter base)
Setup
public int computeSubpopulationLength(Population newpop,
int subpopulation)
public Population breedPopulation(EvolutionState state)
breedPopulation in class Breeder
protected void breedPopChunk(Population newpop,
EvolutionState state,
int[] numinds,
int[] from,
int threadnum)
protected void unmarkElitesEvaluated(Population newpop)
protected void loadElites(EvolutionState state,
Population newpop)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||