Package ec.simple

# Class SimpleStatistics

java.lang.Object
ec.Statistics
ec.simple.SimpleStatistics

All Implemented Interfaces:
  `Setup`, `Singleton`, `SteadyStateStatisticsForm`, `Serializable`

Direct Known Subclasses:
  `HypervolumeStatistics`, `MultiObjectiveStatistics`

public class SimpleStatistics extends Statistics implements SteadyStateStatisticsForm
A basic Statistics class suitable for simple problem applications. SimpleStatistics prints out the best individual, per subpopulation, each generation. At the end of a run, it also prints out the best individual of the run. SimpleStatistics outputs this data to a log which may either be a provided file or stdout. Compressed files will be overridden on restart from checkpoint; uncompressed files will be appended on restart.

SimpleStatistics implements a simple version of steady-state statistics: if it quits before a generation boundary, it will include the best individual discovered, even if the individual was discovered after the last boundary. This is done by using individualsEvaluatedStatistics(...) to update best-individual-of-generation in addition to doing it in postEvaluationStatistics(...).

Parameters

base.`gzip` boolean | (whether or not to compress the file (.gz suffix added)
base.`file` String (a filename), or nonexistant (signifies stdout) | (the log for statistics)
base.`do-final` boolean | (do we print out any final statistics to the log?)
base.`do-generation` boolean | (do we print out any per-generation statistics to the log?)
base.`do-message` boolean | (do we print out any per-generation statistics to stdout?)
base.`do-description` boolean | (do we print out any final description to the log?)
base.`do-per-generation-description` boolean | (do we print out any per-generation description to stdout?)

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `Individual[]`
  `best_of_run`
  The best individual we've found so far
  `boolean`
  `compress`
  Should we compress the file?
  `boolean`
  `doDescription`
  `boolean`
  `doFinal`
  `boolean`
  `doGeneration`
  `boolean`
  `doMessage`
  `boolean`
  `doPerGenerationDescription`
  `static final String`
  `P_COMPRESS`
  compress?
  `static final String`
  `P_DO_DESCRIPTION`
  `static final String`
  `P_DO_FINAL`
  `static final String`
  `P_DO_GENERATION`
  `static final String`
  `P_DO_MESSAGE`
  `static final String`
  `P_DO_PER_GENERATION_DESCRIPTION`
  `static final String`
  `P_STATISTICS_FILE`
  log file parameter
  `int`
  `statisticslog`
  The Statistics' log

  ### Fields inherited from class ec.Statistics

  `children, P_CHILD, P_MUZZLE, P_NUMCHILDREN, P_SILENT, P_SILENT_FILE, P_SILENT_PRINT, silentFile, silentPrint`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleStatistics()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `bypassFinalStatistics(EvolutionState state, int result)`
  Allows MultiObjectiveStatistics etc.
  `protected void`
  `bypassPostEvaluationStatistics(EvolutionState state)`
  Allows MultiObjectiveStatistics etc.
  `void`
  `finalStatistics(EvolutionState state, int result)`
  Logs the best individual of the run.
  `Individual[]`
  `getBestSoFar()`
  `void`
  `postEvaluationStatistics(EvolutionState state)`
  GENERATIONAL: Called immediately after evaluation occurs.
  `void`
  `postInitializationStatistics(EvolutionState state)`
  GENERATIONAL: Called immediately after population initialization occurs.
  `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.Statistics

  `enteringInitialPopulationStatistics, enteringSteadyStateStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postBreedingStatistics, postCheckpointStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preBreedingStatistics, preCheckpointStatistics, preEvaluationStatistics, preInitializationStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics`

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

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

  ### Methods inherited from interface ec.steadystate.SteadyStateStatisticsForm

  `enteringInitialPopulationStatistics, enteringSteadyStateStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postCheckpointStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preCheckpointStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics`

- ## Field Details

  - ### P_STATISTICS_FILE

    public static final String P_STATISTICS_FILE
    log file parameter
    See Also:
      - Constant Field Values

  - ### P_COMPRESS

    public static final String P_COMPRESS
    compress?
    See Also:
      - Constant Field Values

  - ### P_DO_FINAL

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

  - ### P_DO_GENERATION

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

  - ### P_DO_MESSAGE

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

  - ### P_DO_DESCRIPTION

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

  - ### P_DO_PER_GENERATION_DESCRIPTION

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

  - ### statisticslog

    public int statisticslog
    The Statistics' log

  - ### best_of_run

    public Individual[] best_of_run
    The best individual we've found so far

  - ### compress

    public boolean compress
    Should we compress the file?

  - ### doFinal

    public boolean doFinal

  - ### doGeneration

    public boolean doGeneration

  - ### doMessage

    public boolean doMessage

  - ### doDescription

    public boolean doDescription

  - ### doPerGenerationDescription

    public boolean doPerGenerationDescription

- ## Constructor Details

  - ### SimpleStatistics

    public SimpleStatistics()

- ## Method Details

  - ### getBestSoFar

    public Individual[] getBestSoFar()

  - ### 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 `Statistics`

  - ### postInitializationStatistics

    public void postInitializationStatistics(EvolutionState state)
    Description copied from class: `Statistics`
    GENERATIONAL: Called immediately after population initialization occurs.
    Overrides:
      `postInitializationStatistics` in class `Statistics`

  - ### bypassPostEvaluationStatistics

    protected void bypassPostEvaluationStatistics(EvolutionState state)
    Allows MultiObjectiveStatistics etc. to call super.super.postEvaluationStatistics(...) without calling super.postEvaluationStatistics(...)

  - ### postEvaluationStatistics

    public void postEvaluationStatistics(EvolutionState state)
    Description copied from class: `Statistics`
    GENERATIONAL: Called immediately after evaluation occurs.
    Overrides:
      `postEvaluationStatistics` in class `Statistics`

  - ### bypassFinalStatistics

    protected void bypassFinalStatistics(EvolutionState state, int result)
    Allows MultiObjectiveStatistics etc. to call super.super.finalStatistics(...) without calling super.finalStatistics(...)

  - ### finalStatistics

    public void finalStatistics(EvolutionState state, int result)
    Logs the best individual of the run.
    Specified by:
      `finalStatistics` in interface `SteadyStateStatisticsForm`
    Overrides:
      `finalStatistics` in class `Statistics`