Class SteadyStateEvaluator
- All Implemented Interfaces:
Setup,Singleton,Serializable
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
- See Also:
-
Field Summary
Fields inherited from class ec.simple.SimpleEvaluator
C_AUTO, cloneProblem, MERGE_BEST, MERGE_MEAN, MERGE_MEDIAN, mergeForm, numTests, P_CHUNK_SIZE, P_CLONE_PROBLEM, P_MERGE, P_NUM_TESTS, pool, V_AUTO, V_BEST, V_MEAN, V_MEDIANFields inherited from class ec.Evaluator
masterproblem, P_IAMSLAVE, P_MASTERPROBLEM, p_problem, P_PROBLEM, runComplete -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if we're ready to evaluate an individual.voidevaluateIndividual(EvolutionState state, Individual ind, int subpop) Submits an individual to be evaluated by the Problem, and adds it and its subpopulation to the queue.Returns an evaluated individual is in the queue and ready to come back to us.intReturns 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.booleanisIdealFitness(EvolutionState state, Individual ind) The SimpleEvaluator determines that a run is complete by asking each individual in each population if he's optimal; if he finds an individual somewhere that's optimal, he signals that the run is complete.voidprepareToEvaluate(EvolutionState state, int thread) voidsetup(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, runCompleteMethods inherited from class ec.Evaluator
closeContacts, initializeContacts, postEvaluationGlobalUpdate, postEvaluationLocalUpdate, reinitializeContacts, setRunComplete
-
Constructor Details
-
SteadyStateEvaluator
public SteadyStateEvaluator()
-
-
Method Details
-
setup
Description copied from interface:SetupSets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.- Specified by:
setupin interfaceSetup- Overrides:
setupin classSimpleEvaluator
-
prepareToEvaluate
-
evaluateIndividual
Submits an individual to be evaluated by the Problem, and adds it and its subpopulation to the queue. -
canEvaluate
public boolean canEvaluate()Returns true if we're ready to evaluate an individual. Ordinarily this is ALWAYS true, except in the asynchronous evolution situation, where we may not have a processor ready yet. -
getNextEvaluatedIndividual
Returns an evaluated individual is in the queue and ready to come back to us. Ordinarily this is ALWAYS true at the point that we call it, except in the asynchronous evolution situation, where we may not have a job completed yet, in which case NULL is returned. Once an individual is returned by this function, no other individual will be returned until the system is ready to provide us with another one. NULL will be returned otherwise. -
getSubpopulationOfEvaluatedIndividual
public 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. -
isIdealFitness
The SimpleEvaluator determines that a run is complete by asking each individual in each population if he's optimal; if he finds an individual somewhere that's optimal, he signals that the run is complete.
-