Package ec.simple

Class SimpleEvaluator

java.lang.Object
ec.Evaluator
ec.simple.SimpleEvaluator
All Implemented Interfaces:
Setup, Singleton, Serializable
Direct Known Subclasses:
DEEvaluator, DOVSEvaluator, SimpleGroupedEvaluator, SteadyStateEvaluator

public class SimpleEvaluator extends Evaluator
The SimpleEvaluator is a simple, non-coevolved generational evaluator which evaluates every single member of every subpopulation individually in its own problem space. One Problem instance is cloned from p_problem for each evaluating thread, and chunks of individuals are sent to each thread for evaluation. The Problem must implement either SimpleProblemForm or GroupedProblemForm. If a GroupedProblemForm is provided, then an entire chunk of individuals is sent to the problem to be evaluated together in a batch. If a SimpleProblemForm is provided, then each thread sends individuals sequentially to be evaluated one-at-a-time.
See Also:
  • Field Details

  • Constructor Details

    • SimpleEvaluator

      public SimpleEvaluator()
  • Method Details

    • 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 Evaluator
    • evaluatePopulation

      public void evaluatePopulation(EvolutionState state)
      A simple evaluator that doesn't do any coevolutionary evaluation. Basically it applies evaluation pipelines, one per thread, to various subchunks of a new population.
      Specified by:
      evaluatePopulation in class Evaluator
    • runComplete

      public String runComplete(EvolutionState state)
      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.
      Specified by:
      runComplete in class Evaluator
    • evalPopChunk

      protected void evalPopChunk(EvolutionState state, int[] numinds, int[] from, int threadnum, Problem p)
      A private helper function for evaluatePopulation which evaluates a chunk of individuals in a subpopulation for a given thread. Although this method is declared protected, you should not call it.