|
|||||||||
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
This subclass of EvolutionState implements basic Steady-State Evolution and (in distributed form) Asynchronous Evolution. The procedure is as follows. We begin with an empty Population and one by one create new Indivdiuals and send them off to be evaluated. In basic Steady-State Evolution the individuals are immediately evaluated and we wait for them; but in Asynchronous Evolution the individuals are evaluated for however long it takes and we don't wait for them to finish. When individuals return they are added to the Population until it is full. No duplicate individuals are allowed.
At this point the system switches to its "steady state": individuals are bred from the population one by one, and sent off to be evaluated. Once again, in basic Steady-State Evolution the individuals are immediately evaluated and we wait for them; but in Asynchronous Evolution the individuals are evaluated for however long it takes and we don't wait for them to finish. When an individual returns, we mark an individual in the Population for death, then replace it with the new returning individual. Note that during the steady-state, Asynchronous Evolution could be still sending back some "new" individuals created during the initialization phase, not "bred" individuals.
The determination of how an individual is marked for death is done by the SteadyStateBreeder.
SteadyStateEvolutionState will run either for some N "generations" or for some M evaluations of individuals. A "generation" is defined as a Population's worth of evaluations. If you do not specify the number of evaluations (the M), then SteadyStateEvolutionState will use the standard generations parameter defined in EvolutionState.
Parameters
evaluations int >= 1 |
(maximal number of evaluations to run.) |
Field Summary | |
---|---|
long |
evaluations
How many evaluations have we run so far? |
protected boolean |
firstTime
First time calling evolve |
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. |
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
base parameter for steady-state |
static long |
UNDEFINED
|
Constructor Summary | |
---|---|
SteadyStateEvolutionState()
|
Method Summary | |
---|---|
int |
evolve()
|
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_NUMEVALUATIONS
public boolean generationBoundary
public long numEvaluations
public static long UNDEFINED
public int generationSize
public long evaluations
protected boolean firstTime
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 |