|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.EvolutionState
ec.steadystate.SteadyStateEvolutionState
public class SteadyStateEvolutionState
A SteadyStateEvolutionState is an EvolutionState which implements a simple form of steady-state evolution.
First, all the individuals in the population are created and evaluated. (A) Then 1 individual is selected by the breder for removal from the population. They are replaced by the result of breeding the other individuals in the population. Then just those newly-bred individuals are evaluted. Goto (A).
The individual selected for removal is done so by calling the deselector for that subpopulation. Deselectors are stored and defined in SteadyStateBreeder.
A generation is defined as the interval in which N indidivuals are evaluated, where N is set to the size of subpopulation 0. SteadyStateEvolutioState keeps track of both generations and number of evaluations performed so far.
Exchanges and checkpointing occur each generation.
Evolution stops in any of the following conditions:
Additional constraints:
If your statistics object adheres to SteadyStateStatisticsForm, it will receive additional statistics as specified in that form. If it does not adhere to this form, you should be aware that the evaluation and breeding statistics hooks are called oddly: they wrap the evaluation of the first individual of a generation and the subsequent breeding of the population immediately thereafter. Thus because it's steady-state and fine-grained, a lot of evaluations and breedings occur for which the statistics hooks are NOT called. Furthermore, exchanges only occur on the generation boundary, and are wrapped with statistics hooks there.
Parameters
breed classname, inherits or = ec.steadystate.SteadyStateBreeder |
(the class for breeder) |
eval classname, inherits or = ec.steadystate.SteadyStateEvaluator |
(the class for evaluator) |
evaluations int >= 1 or undefined (the default) |
Number of evaluations to perform. If this parameter is undefined, number of generations is used instead |
Field Summary | |
---|---|
long |
evaluations
How many evaluations have we run so far? |
boolean |
firstTimeAround
Is this the first time the population is being evaluated, and so the *entire* population must be evaluated? |
boolean |
generationBoundary
Did we just start a new generation? |
int |
generationSize
how big is a generation? Set to the size of subpopulation 0 of the initial population. |
int[] |
newIndividuals
The breeder puts the index of the newly-bred individuals in this array for the Evaluator to find them, one per subpopulation |
long |
numEvaluations
How many evaluations should we run for? If set to UNDEFINED (0), we run for the number of generations instead. |
static java.lang.String |
P_NUMEVALUATIONS
|
static java.lang.String |
P_STEADYSTATE
base parameter for steady-state |
static long |
UNDEFINED
|
Constructor Summary | |
---|---|
SteadyStateEvolutionState()
|
Method Summary | |
---|---|
int |
evolve()
Performs the evolutionary run. |
void |
finish(int result)
|
void |
setup(EvolutionState state,
Parameter base)
Unlike for other setup() methods, ignore the base; it will always be null. |
void |
startFresh()
|
Methods inherited from class ec.EvolutionState |
---|
resetFromCheckpoint, run, startFromCheckpoint |
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_STEADYSTATE
public static final java.lang.String P_NUMEVALUATIONS
public int[] newIndividuals
public boolean generationBoundary
public boolean firstTimeAround
public long numEvaluations
public static long UNDEFINED
public int generationSize
public long evaluations
Constructor Detail |
---|
public SteadyStateEvolutionState()
Method Detail |
---|
public void setup(EvolutionState state, Parameter base)
EvolutionState
setup
in interface Setup
setup
in class EvolutionState
Prototype.setup(EvolutionState,Parameter)
public void startFresh()
startFresh
in class EvolutionState
public int evolve()
evolve
in class EvolutionState
public void finish(int result)
finish
in class EvolutionState
result
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |