Package ec.simple
Class SimpleShortStatistics
java.lang.Object
ec.Statistics
ec.simple.SimpleShortStatistics
- All Implemented Interfaces:
Setup,Singleton,Serializable
- Direct Known Subclasses:
KozaShortStatistics
A Simple-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 do-time is true, then timing information is also given. If do-size is true, then size information is also given.
No final statistics information is provided. You can also set SimpleShortStatistics to only output every *modulus* generations
to keep the tally shorter. And you can gzip the statistics file.
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-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 fitness of the subpopulation this generation
- The best fitness of the subpopulation this generation
- The best fitness of the subpopulation so far in the run
Then the following items appear, for the whole population:
- (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 fitness this generation
- The best fitness this generation
- The best fitness so far in the run
Parameters
| base.file String (a filename), or nonexistant (signifies stdout) |
(the log for statistics) |
| base.gzip boolean |
(whether or not to compress the file (.gz suffix added) |
| base.modulus integer >= 1 (default) |
(How often (in generations) should we print a statistics line?) |
| base.do-time bool = true or false (default) |
(print timing information?) |
| base.do-size bool = true or false (default) |
(print sizing information?) |
| base.do-subpops bool = true or false (default) |
(print information on a per-subpop basis as well as per-population?) |
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanbooleanbooleanbooleanlongintstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringintdouble[]long[]long[]long[]long[]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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgatherExtraPopStatistics(EvolutionState state, int subpop) protected voidgatherExtraSubpopStatistics(EvolutionState state, int subpop, int individual) voidGENERATIONAL: Called immediately after breeding occurs.voidPrints out the statistics, but does not end with a println -- this lets overriding methods print additional statistics on the same linevoidGENERATIONAL: Called immediately after population initialization occurs.voidGENERATIONAL: Called immediately before breeding occurs.voidGENERATIONAL: Called immediately before evaluation occurs.voidCalled immediately before population initialization occurs.protected voidprepareStatistics(EvolutionState state) protected voidprotected voidprotected voidprintExtraSubpopStatisticsAfter(EvolutionState state, int subpop) protected voidprintExtraSubpopStatisticsBefore(EvolutionState state, int subpop) voidsetup(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, finalStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postCheckpointStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preCheckpointStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics
-
Field Details
-
P_STATISTICS_MODULUS
- See Also:
-
P_DELIMITER
- See Also:
-
P_COMPRESS
- See Also:
-
P_FULL
- See Also:
-
P_DO_SIZE
- See Also:
-
P_DO_TIME
- See Also:
-
P_DO_SUBPOPS
- See Also:
-
P_DO_HEADER
- See Also:
-
P_STATISTICS_FILE
- See Also:
-
statisticslog
public int statisticslog -
modulus
public int modulus -
delimiter
-
doSize
public boolean doSize -
doTime
public boolean doTime -
doSubpops
public boolean doSubpops -
doHeader
public boolean doHeader -
bestSoFar
-
totalSizeSoFar
public long[] totalSizeSoFar -
totalIndsSoFar
public long[] totalIndsSoFar -
totalIndsThisGen
public long[] totalIndsThisGen -
totalSizeThisGen
public long[] totalSizeThisGen -
totalFitnessThisGen
public double[] totalFitnessThisGen -
bestOfGeneration
-
lastTime
public long lastTime
-
-
Constructor Details
-
SimpleShortStatistics
public SimpleShortStatistics()
-
-
Method Details
-
setup
Description copied from interface:SetupSets 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:
setupin interfaceSetup- Overrides:
setupin classStatistics
-
getBestSoFar
-
preInitializationStatistics
Description copied from class:StatisticsCalled immediately before population initialization occurs.- Overrides:
preInitializationStatisticsin classStatistics
-
postInitializationStatistics
Description copied from class:StatisticsGENERATIONAL: Called immediately after population initialization occurs.- Overrides:
postInitializationStatisticsin classStatistics
-
preBreedingStatistics
Description copied from class:StatisticsGENERATIONAL: Called immediately before breeding occurs.- Overrides:
preBreedingStatisticsin classStatistics
-
postBreedingStatistics
Description copied from class:StatisticsGENERATIONAL: Called immediately after breeding occurs.- Overrides:
postBreedingStatisticsin classStatistics
-
preEvaluationStatistics
Description copied from class:StatisticsGENERATIONAL: Called immediately before evaluation occurs.- Overrides:
preEvaluationStatisticsin classStatistics
-
prepareStatistics
-
gatherExtraSubpopStatistics
-
printExtraSubpopStatisticsBefore
-
printExtraSubpopStatisticsAfter
-
gatherExtraPopStatistics
-
printExtraPopStatisticsBefore
-
printExtraPopStatisticsAfter
-
postEvaluationStatistics
Prints out the statistics, but does not end with a println -- this lets overriding methods print additional statistics on the same line- Overrides:
postEvaluationStatisticsin classStatistics
-