|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.Breeder
ec.es.MuCommaLambdaBreeder
MuCommaLambdaBreeder is a Breeder which, together with ESSelection, implements the (mu,lambda) breeding strategy and gathers the comparison data you can use to implement a 1/5-rule mutation mechanism.
Evolution strategies breeders require a "mu" parameter and a "lambda" parameter for each subpopulation. "mu" refers to the number of parents from which the new population will be built. "lambda" refers to the number of children generated by the mu parents. Subpopulation sizes will change as necessary to accommodate this fact in later generations. The only rule for initial subpopulation sizes is that they must be greater than or equal to the mu parameter for that subpopulation.
You can now set your initial subpopulation size to whatever you like, totally independent of lambda and mu, as long as it is >= mu.
MuCommaLambdaBreeder stores mu and lambda values for each subpopulation in the population, as well as comparisons. A comparison tells you if >1/5, <1/5 or =1/5 of the new population was better than its parents (the so-called evolution strategies "one-fifth rule". Although the comparisons are gathered, no mutation objects are provided which actually use them -- you're free to use them in any mutation objects you care to devise which requires them.
To do evolution strategies evolution, the breeding pipelines must contain exactly one ESSelection object called each time an individual is generated. For example, if you're just generating children by mutating a single selected individual into a child, then you use the ESSelection object to pick that individual. If you're generating two children at a time by selecting two parents and crossing them over, then each parent should be selected with ESSelection (and in this case, you had better have a population size that's an even number!) If you're generating one child at a time by selecting two parents and crossing them over, then throwing away one of the children and mutating the other, then you should have only one parent chosen through ESSelection; the other might be chosen with Tournament Selection, say.
Parameters
es.lambda.subpop-num int >= 0 | Specifies the 'lambda' parameter for the subpopulation. |
es.mu.subpop-num int: a multiple of "lambda" | Specifies the 'mu' parameter for the subpopulation. |
Field Summary | |
static byte |
C_EXACTLY_ONE_FIFTH_BETTER
|
static byte |
C_OVER_ONE_FIFTH_BETTER
|
static byte |
C_UNDER_ONE_FIFTH_BETTER
|
byte[] |
comparison
|
int[] |
count
Modified by multiple threads, don't fool with this |
int[] |
lambda
|
int[] |
mu
|
static java.lang.String |
P_LAMBDA
|
static java.lang.String |
P_MU
|
Population |
parentPopulation
|
Constructor Summary | |
MuCommaLambdaBreeder()
|
Method Summary | |
void |
breedPopChunk(Population newpop,
EvolutionState state,
int[][] bettercount,
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)
Breeds state.population, returning a new population. |
Population |
postProcess(Population newpop,
Population oldpop,
EvolutionState state)
A hook for Mu+Lambda, not used in Mu,Lambda |
Population |
setToLambda(Population pop,
EvolutionState state)
Sets all subpopulations in pop to the expected lambda size. |
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 |
public static final java.lang.String P_MU
public static final java.lang.String P_LAMBDA
public int[] mu
public int[] lambda
public Population parentPopulation
public byte[] comparison
public static final byte C_OVER_ONE_FIFTH_BETTER
public static final byte C_UNDER_ONE_FIFTH_BETTER
public static final byte C_EXACTLY_ONE_FIFTH_BETTER
public int[] count
Constructor Detail |
public MuCommaLambdaBreeder()
Method Detail |
public void setup(EvolutionState state, Parameter base)
Setup
public Population setToLambda(Population pop, EvolutionState state)
public Population breedPopulation(EvolutionState state) throws java.lang.CloneNotSupportedException
Breeder
breedPopulation
in class Breeder
java.lang.CloneNotSupportedException
public Population postProcess(Population newpop, Population oldpop, EvolutionState state)
public void breedPopChunk(Population newpop, EvolutionState state, int[][] bettercount, int[] numinds, int[] from, int threadnum) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |