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:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `C_AUTO`
  `boolean`
  `cloneProblem`
  `static final int`
  `MERGE_BEST`
  `static final int`
  `MERGE_MEAN`
  `static final int`
  `MERGE_MEDIAN`
  `int`
  `mergeForm`
  `int`
  `numTests`
  `static final String`
  `P_CHUNK_SIZE`
  `static final String`
  `P_CLONE_PROBLEM`
  `static final String`
  `P_MERGE`
  `static final String`
  `P_NUM_TESTS`
  `ThreadPool`
  `pool`
  `static final String`
  `V_AUTO`
  `static final String`
  `V_BEST`
  `static final String`
  `V_MEAN`
  `static final String`
  `V_MEDIAN`

  ### Fields inherited from class ec.Evaluator

  `masterproblem, P_IAMSLAVE, P_MASTERPROBLEM, p_problem, P_PROBLEM, runComplete`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleEvaluator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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.
  `void`
  `evaluatePopulation(EvolutionState state)`
  A simple evaluator that doesn't do any coevolutionary evaluation.
  `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.
  `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.Evaluator

  `closeContacts, initializeContacts, postEvaluationGlobalUpdate, postEvaluationLocalUpdate, reinitializeContacts, setRunComplete`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### P_CLONE_PROBLEM

    public static final String P_CLONE_PROBLEM
    See Also:
      - Constant Field Values

  - ### P_NUM_TESTS

    public static final String P_NUM_TESTS
    See Also:
      - Constant Field Values

  - ### P_MERGE

    public static final String P_MERGE
    See Also:
      - Constant Field Values

  - ### V_MEAN

    public static final String V_MEAN
    See Also:
      - Constant Field Values

  - ### V_MEDIAN

    public static final String V_MEDIAN
    See Also:
      - Constant Field Values

  - ### V_BEST

    public static final String V_BEST
    See Also:
      - Constant Field Values

  - ### P_CHUNK_SIZE

    public static final String P_CHUNK_SIZE
    See Also:
      - Constant Field Values

  - ### V_AUTO

    public static final String V_AUTO
    See Also:
      - Constant Field Values

  - ### MERGE_MEAN

    public static final int MERGE_MEAN
    See Also:
      - Constant Field Values

  - ### MERGE_MEDIAN

    public static final int MERGE_MEDIAN
    See Also:
      - Constant Field Values

  - ### MERGE_BEST

    public static final int MERGE_BEST
    See Also:
      - Constant Field Values

  - ### numTests

    public int numTests

  - ### mergeForm

    public int mergeForm

  - ### cloneProblem

    public boolean cloneProblem

  - ### C_AUTO

    public static final int C_AUTO
    See Also:
      - Constant Field Values

  - ### pool

    public ThreadPool pool

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