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
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe best individual we've found so farbooleanShould we compress the file?booleanbooleanbooleanbooleanbooleanstatic final Stringcompress?static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringlog file parameterintThe Statistics' logFields 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 voidbypassFinalStatistics(EvolutionState state, int result) Allows MultiObjectiveStatistics etc.protected voidAllows MultiObjectiveStatistics etc.voidfinalStatistics(EvolutionState state, int result) Logs the best individual of the run.voidGENERATIONAL: Called immediately after evaluation occurs.voidGENERATIONAL: Called immediately after population initialization occurs.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, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postBreedingStatistics, postCheckpointStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preBreedingStatistics, preCheckpointStatistics, preEvaluationStatistics, preInitializationStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatisticsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ec.steadystate.SteadyStateStatisticsForm
enteringInitialPopulationStatistics, enteringSteadyStateStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postCheckpointStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preCheckpointStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics
-
Field Details
-
P_STATISTICS_FILE
log file parameter- See Also:
-
P_COMPRESS
compress?- See Also:
-
P_DO_FINAL
- See Also:
-
P_DO_GENERATION
- See Also:
-
P_DO_MESSAGE
- See Also:
-
P_DO_DESCRIPTION
- See Also:
-
P_DO_PER_GENERATION_DESCRIPTION
- See Also:
-
statisticslog
public int statisticslogThe Statistics' log -
best_of_run
The best individual we've found so far -
compress
public boolean compressShould 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
-
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
-
postInitializationStatistics
Description copied from class:StatisticsGENERATIONAL: Called immediately after population initialization occurs.- Overrides:
postInitializationStatisticsin classStatistics
-
bypassPostEvaluationStatistics
Allows MultiObjectiveStatistics etc. to call super.super.postEvaluationStatistics(...) without calling super.postEvaluationStatistics(...) -
postEvaluationStatistics
Description copied from class:StatisticsGENERATIONAL: Called immediately after evaluation occurs.- Overrides:
postEvaluationStatisticsin classStatistics
-
bypassFinalStatistics
Allows MultiObjectiveStatistics etc. to call super.super.finalStatistics(...) without calling super.finalStatistics(...) -
finalStatistics
Logs the best individual of the run.- Specified by:
finalStatisticsin interfaceSteadyStateStatisticsForm- Overrides:
finalStatisticsin classStatistics
-