ec.es
Class ESEvolutionState
java.lang.Object
|
+--ec.EvolutionState
|
+--ec.simple.SimpleEvolutionState
|
+--ec.es.ESEvolutionState
- public class ESEvolutionState
- extends SimpleEvolutionState
ESEvolutionState is an EvolutionState which accepts the (mu,lambda)
and (mu+lambda) breeding strategies found in the ec.es.MuPlusLambdaBreeder
and ec.es.MuCommaLambdaBreeder breeders, to do evolution-strategies style
evolution.
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 -- and in this
implementation, this is the same thing as the initial subpopulation size.
Note that during the course of an ec.es.MuPlusLambdaBreeder run,
in the second generation the subpopulation size will rise from
lambda to be equal to mu + lambda. Thereafter it stays at mu + lambda.
"mu" is determined by a user parameter below. "lambda" is simply
the initial subpopulation size (pop.subpop.foo.size).
ESEvolutionState 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, you need to use an ESEvolutionState
object, either MuCommaLambdaBreeder or MuPlusLambdaBreeder, and 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
breed.mu.subpop-num
int: a multiple of "lambda", that is, the initial size of subpop subpop-num |
- See Also:
- Serialized Form
Fields inherited from class ec.EvolutionState |
aggressivegc,
breeder,
breedthreads,
C_STARTED_FRESH,
C_STARTED_FROM_CHECKPOINT,
checkpoint,
checkpointModulo,
checkpointPrefix,
evalthreads,
evaluator,
exchanger,
finisher,
gc,
gcModulo,
generation,
initializer,
numGenerations,
output,
P_AGGRESSIVEGC,
P_BREEDER,
P_CHECKPOINT,
P_CHECKPOINTMODULO,
P_CHECKPOINTPREFIX,
P_EVALUATOR,
P_EXCHANGER,
P_FINISHER,
P_GC,
P_GCMODULO,
P_GENERATIONS,
P_INITIALIZER,
P_QUITONRUNCOMPLETE,
P_STATISTICS,
parameters,
population,
quitOnRunComplete,
R_FAILURE,
R_SUCCESS,
random,
statistics |
Method Summary |
void |
go()
Steps through a run for debugging purposes. |
void |
run(int condition)
Starts the run. |
void |
setup(EvolutionState state,
Parameter base)
Unlike for other setup() methods, ignore the base; it will always be null. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
P_MU
public static final java.lang.String P_MU
mu
public int[] mu
lambda
public int[] lambda
comparison
public byte[] comparison
C_OVER_ONE_FIFTH_BETTER
public static final byte C_OVER_ONE_FIFTH_BETTER
C_UNDER_ONE_FIFTH_BETTER
public static final byte C_UNDER_ONE_FIFTH_BETTER
C_EXACTLY_ONE_FIFTH_BETTER
public static final byte C_EXACTLY_ONE_FIFTH_BETTER
count
public int[] count
- Modified by multiple threads, don't fool with this
ESEvolutionState
public ESEvolutionState()
setup
public void setup(EvolutionState state,
Parameter base)
- Description copied from class: EvolutionState
- Unlike for other setup() methods, ignore the base; it will always be null.
- Overrides:
- setup in class EvolutionState
- Tags copied from class: EvolutionState
- See Also:
Prototype.setup(EvolutionState,Parameter)
run
public void run(int condition)
throws java.io.IOException
- Description copied from class: EvolutionState
- Starts the run. condition indicates whether or not the
run was restarted from a checkpoint (C_STARTED_FRESH vs
C_STARTED_FROM_CHECKPOINT). At the point that run(...) has been
called, the parameter database has already been set up, as have
the random number generators, the number of threads, and the
Output facility. This method should call this.setup(...) to
set up the EvolutionState object if condition equals C_STARTED_FRESH.
- Overrides:
- run in class SimpleEvolutionState
go
public void go()
throws java.io.IOException
- Description copied from class: EvolutionState
- Steps through a run for debugging purposes.
A debug-run is done by repeatedly pulsing the go() method. The
default form prints a message saying that nothing happens.
- Overrides:
- go in class SimpleEvolutionState