ec.steadystate
Class SteadyStateEvaluator

java.lang.Object
  extended by ec.Evaluator
      extended by ec.simple.SimpleEvaluator
          extended by ec.steadystate.SteadyStateEvaluator
All Implemented Interfaces:
Setup, Singleton, java.io.Serializable

public class SteadyStateEvaluator
extends SimpleEvaluator

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ec.simple.SimpleEvaluator
SimpleEvaluator.SimpleEvaluatorThread
 
Field Summary
 SimpleProblemForm problem
          Our problem.
 
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.
 QueueIndividual getNextEvaluatedIndividual(EvolutionState state)
          Returns the QueueIndividual from the front of the queue.
 boolean isNextEvaluatedIndividualAvailable()
          Returns true if an evaluated individual is in the queue and ready to come back to us.
 QueueIndividual pollNextEvaluatedIndividual(EvolutionState state, long timeoutInMilliseconds)
          Polls for the next individual.
 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
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
 

Field Detail

problem

public SimpleProblemForm problem
Our problem.

Constructor Detail

SteadyStateEvaluator

public SteadyStateEvaluator()
Method Detail

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Setup
Sets 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:
setup in interface Setup
Overrides:
setup in class SimpleEvaluator

prepareToEvaluate

public void prepareToEvaluate(EvolutionState state,
                              int thread)

evaluateIndividual

public 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.


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.


isNextEvaluatedIndividualAvailable

public boolean isNextEvaluatedIndividualAvailable()
Returns true if 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.


getNextEvaluatedIndividual

public QueueIndividual getNextEvaluatedIndividual(EvolutionState state)
Returns the QueueIndividual from the front of the queue. Assumes the user already knows that the queue is not empty


pollNextEvaluatedIndividual

public QueueIndividual pollNextEvaluatedIndividual(EvolutionState state,
                                                   long timeoutInMilliseconds)
Polls for the next individual.

Returns:
Next individual, or null if no individual is received before the timeout period.