|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.Evaluator
ec.simple.SimpleEvaluator
ec.steadystate.SteadyStateEvaluator
public class SteadyStateEvaluator
This subclass of Evaluator performs the evaluation portion of 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.
When SteadyStateEvaluator sends indivduals off to be evaluated, it stores them in an internal queue, along with the subpopulation in which they were destined. This tuple is defined by QueueIndividual.java
Field Summary |
---|
Fields inherited from class ec.Evaluator |
---|
P_IAMSLAVE, P_MASTERPROBLEM, p_problem, P_PROBLEM |
Constructor Summary | |
---|---|
SteadyStateEvaluator()
|
Method Summary | |
---|---|
boolean |
canEvaluate()
Returns true if we're ready to evaluate an individual. |
void |
evaluateIndividual(EvolutionState state,
Individual ind,
int subpop)
Submits an individual to be evaluated by the Problem, and adds it and its subpopulation to the queue. |
Individual |
getNextEvaluatedIndividual()
Returns an evaluated individual is in the queue and ready to come back to us. |
int |
getSubpopulationOfEvaluatedIndividual()
Returns the subpopulation of the last evaluated individual returned by getNextEvaluatedIndividual, or potentially -1 if getNextEvaluatedIndividual was never called or hasn't returned an individual yet. |
void |
prepareToEvaluate(EvolutionState state,
int thread)
|
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 ec.simple.SimpleEvaluator |
---|
evalPopChunk, evaluatePopulation, runComplete |
Methods inherited from class ec.Evaluator |
---|
closeContacts, initializeContacts, reinitializeContacts |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SteadyStateEvaluator()
Method Detail |
---|
public void setup(EvolutionState state, Parameter base)
Setup
setup
in interface Setup
setup
in class SimpleEvaluator
public void prepareToEvaluate(EvolutionState state, int thread)
public void evaluateIndividual(EvolutionState state, Individual ind, int subpop)
public boolean canEvaluate()
public Individual getNextEvaluatedIndividual()
public int getSubpopulationOfEvaluatedIndividual()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |