Package ec.gp.koza

# Class KozaShortStatistics

java.lang.Object
ec.Statistics
ec.simple.SimpleShortStatistics
ec.gp.koza.KozaShortStatistics

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

public class KozaShortStatistics extends SimpleShortStatistics
A Koza-style statistics generator, intended to be easily parseable with awk or other Unix tools. Prints fitness information, one generation (or pseudo-generation) per line. If gather-full is true, then timing information, number of nodes and depths of trees, etc. are also given. No final statistics information is given.

Each line represents a single generation. The first items on a line are always:

- The generation number
- (if do-time) how long initialization took in milliseconds, or how long the previous generation took to breed to form this generation
- (if do-time) How long evaluation took in milliseconds this generation

Then, (if do-subpops) the following items appear, once per each subpopulation:

- (if do-depth) [a b c...], representing the average depth of tree a, b, etc. of individuals this generation
- (if do-size) [a b c...], representing the average number of nodes used in tree a, b, etc. of individuals this generation
- (if do-size) The average size of an individual this generation
- (if do-size) The average size of an individual so far in the run
- (if do-size) The size of the best individual this generation
- (if do-size) The size of the best individual so far in the run
- The mean standardized fitness of the subpopulation this generation
- The best standardized fitness of the subpopulation this generation
- The best standardized fitness of the subpopulation so far in the run

Then the following items appear, for the whole population:

- (if do-depth) [a b c...], representing the average depth of tree a, b, etc. of individuals this generation
- (if do-size) [a b c...], representing the average number of nodes used in tree a, b, etc. of individuals this generation
- (if do-size) The average size of an individual this generation
- (if do-size) The average size of an individual so far in the run
- (if do-size) The size of the best individual this generation
- (if do-size) The size of the best individual so far in the run
- The mean standardized fitness of the subpopulation this generation
- The best standardized fitness of the subpopulation this generation
- The best standardized fitness of the subpopulation so far in the run

KozaStatistics assumes that every one of the Individuals in your population (and all subpopualtions) are GPIndividuals, and further that they all have the same number of trees. Besides the parameter below, KozaShortStatistics obeys all the SimpleShortStatistics parameters.

Parameters

base.`do-depth` bool = `true` or `false` (default) | (print depth information?)

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `boolean`
  `doDepth`
  `static final String`
  `P_DO_DEPTH`

  ### Fields inherited from class ec.simple.SimpleShortStatistics

  `bestOfGeneration, bestSoFar, delimiter, doHeader, doSize, doSubpops, doTime, lastTime, modulus, P_COMPRESS, P_DELIMITER, P_DO_HEADER, P_DO_SIZE, P_DO_SUBPOPS, P_DO_TIME, P_FULL, P_STATISTICS_FILE, P_STATISTICS_MODULUS, statisticslog, totalFitnessThisGen, totalIndsSoFar, totalIndsThisGen, totalSizeSoFar, totalSizeThisGen`

  ### 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
  `KozaShortStatistics()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `gatherExtraSubpopStatistics(EvolutionState state, int subpop, int individual)`
  `void`
  `postInitializationStatistics(EvolutionState state)`
  GENERATIONAL: Called immediately after population initialization occurs.
  `protected void`
  `prepareStatistics(EvolutionState state)`
  `protected void`
  `printExtraPopStatisticsBefore(EvolutionState state)`
  `protected void`
  `printExtraSubpopStatisticsBefore(EvolutionState state, int subpop)`
  `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.SimpleShortStatistics

  `gatherExtraPopStatistics, getBestSoFar, postBreedingStatistics, postEvaluationStatistics, preBreedingStatistics, preEvaluationStatistics, preInitializationStatistics, printExtraPopStatisticsAfter, printExtraSubpopStatisticsAfter`

  ### Methods inherited from class ec.Statistics

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

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

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

- ## Field Details

  - ### P_DO_DEPTH

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

  - ### doDepth

    public boolean doDepth

- ## Constructor Details

  - ### KozaShortStatistics

    public KozaShortStatistics()

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

  - ### postInitializationStatistics

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

  - ### prepareStatistics

    protected void prepareStatistics(EvolutionState state)
    Overrides:
      `prepareStatistics` in class `SimpleShortStatistics`

  - ### gatherExtraSubpopStatistics

    protected void gatherExtraSubpopStatistics(EvolutionState state, int subpop, int individual)
    Overrides:
      `gatherExtraSubpopStatistics` in class `SimpleShortStatistics`

  - ### printExtraSubpopStatisticsBefore

    protected void printExtraSubpopStatisticsBefore(EvolutionState state, int subpop)
    Overrides:
      `printExtraSubpopStatisticsBefore` in class `SimpleShortStatistics`

  - ### printExtraPopStatisticsBefore

    protected void printExtraPopStatisticsBefore(EvolutionState state)
    Overrides:
      `printExtraPopStatisticsBefore` in class `SimpleShortStatistics`