ec.simple
Class SimpleStatistics
- java.lang.Object
-
- ec.Statistics
-
- ec.simple.SimpleStatistics
-
- All Implemented Interfaces:
- Setup, Singleton, SteadyStateStatisticsForm, java.io.Serializable
- Direct Known Subclasses:
- 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) - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description Individual[]best_of_runThe best individual we've found so farbooleancompressShould we compress the file?booleandoDescriptionbooleandoFinalbooleandoGenerationbooleandoMessagebooleandoPerGenerationDescriptionstatic java.lang.StringP_COMPRESScompress?static java.lang.StringP_DO_DESCRIPTIONstatic java.lang.StringP_DO_FINALstatic java.lang.StringP_DO_GENERATIONstatic java.lang.StringP_DO_MESSAGEstatic java.lang.StringP_DO_PER_GENERATION_DESCRIPTIONstatic java.lang.StringP_STATISTICS_FILElog file parameterintstatisticslogThe 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 and Description SimpleStatistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidfinalStatistics(EvolutionState state, int result)Logs the best individual of the run.Individual[]getBestSoFar()voidpostEvaluationStatistics(EvolutionState state)Logs the best individual of the generation.voidpostInitializationStatistics(EvolutionState state)GENERATIONAL: 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, prePreBreedingExchangeStatistics
-
Methods inherited from class java.lang.Object
equals, 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 Detail
-
P_STATISTICS_FILE
public static final java.lang.String P_STATISTICS_FILE
log file parameter- See Also:
- Constant Field Values
-
P_COMPRESS
public static final java.lang.String P_COMPRESS
compress?- See Also:
- Constant Field Values
-
P_DO_FINAL
public static final java.lang.String P_DO_FINAL
- See Also:
- Constant Field Values
-
P_DO_GENERATION
public static final java.lang.String P_DO_GENERATION
- See Also:
- Constant Field Values
-
P_DO_MESSAGE
public static final java.lang.String P_DO_MESSAGE
- See Also:
- Constant Field Values
-
P_DO_DESCRIPTION
public static final java.lang.String P_DO_DESCRIPTION
- See Also:
- Constant Field Values
-
P_DO_PER_GENERATION_DESCRIPTION
public static final java.lang.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
-
-
Method Detail
-
getBestSoFar
public Individual[] getBestSoFar()
-
setup
public void setup(EvolutionState state, Parameter base)
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
public void postInitializationStatistics(EvolutionState state)
Description copied from class:StatisticsGENERATIONAL: Called immediately after population initialization occurs.- Overrides:
postInitializationStatisticsin classStatistics
-
postEvaluationStatistics
public void postEvaluationStatistics(EvolutionState state)
Logs the best individual of the generation.- Overrides:
postEvaluationStatisticsin classStatistics
-
finalStatistics
public void finalStatistics(EvolutionState state, int result)
Logs the best individual of the run.- Specified by:
finalStatisticsin interfaceSteadyStateStatisticsForm- Overrides:
finalStatisticsin classStatistics
-
-
DMelt 3.0 © DataMelt by jWork.ORG