ec.simple
Class SimpleShortStatistics
- java.lang.Object
-
- ec.Statistics
-
- ec.simple.SimpleShortStatistics
-
- Direct Known Subclasses:
- KozaShortStatistics
public class SimpleShortStatistics extends Statistics
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description Individual[]bestOfGenerationIndividual[]bestSoFarbooleandoSizebooleandoSubpopsbooleandoTimelonglastTimeintmodulusstatic java.lang.StringP_COMPRESSstatic java.lang.StringP_DO_SIZEstatic java.lang.StringP_DO_SUBPOPSstatic java.lang.StringP_DO_TIMEstatic java.lang.StringP_FULLstatic java.lang.StringP_STATISTICS_FILEstatic java.lang.StringP_STATISTICS_MODULUSintstatisticslogdouble[]totalFitnessThisGenlong[]totalIndsSoFarlong[]totalIndsThisGenlong[]totalSizeSoFarlong[]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 and Description SimpleShortStatistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Individual[]getBestSoFar()voidpostBreedingStatistics(EvolutionState state)GENERATIONAL: Called immediately after breeding occurs.voidpostEvaluationStatistics(EvolutionState state)Prints out the statistics, but does not end with a println -- this lets overriding methods print additional statistics on the same linevoidpostInitializationStatistics(EvolutionState state)GENERATIONAL: Called immediately after population initialization occurs.voidpreBreedingStatistics(EvolutionState state)GENERATIONAL: Called immediately before breeding occurs.voidpreEvaluationStatistics(EvolutionState state)GENERATIONAL: Called immediately before evaluation occurs.voidpreInitializationStatistics(EvolutionState state)Called immediately before 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, finalStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postCheckpointStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preCheckpointStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics
-
-
-
-
Field Detail
-
P_STATISTICS_MODULUS
public static final java.lang.String P_STATISTICS_MODULUS
- See Also:
- Constant Field Values
-
P_COMPRESS
public static final java.lang.String P_COMPRESS
- See Also:
- Constant Field Values
-
P_FULL
public static final java.lang.String P_FULL
- See Also:
- Constant Field Values
-
P_DO_SIZE
public static final java.lang.String P_DO_SIZE
- See Also:
- Constant Field Values
-
P_DO_TIME
public static final java.lang.String P_DO_TIME
- See Also:
- Constant Field Values
-
P_DO_SUBPOPS
public static final java.lang.String P_DO_SUBPOPS
- See Also:
- Constant Field Values
-
P_STATISTICS_FILE
public static final java.lang.String P_STATISTICS_FILE
- See Also:
- Constant Field Values
-
statisticslog
public int statisticslog
-
modulus
public int modulus
-
doSize
public boolean doSize
-
doTime
public boolean doTime
-
doSubpops
public boolean doSubpops
-
bestSoFar
public Individual[] bestSoFar
-
totalSizeSoFar
public long[] totalSizeSoFar
-
totalIndsSoFar
public long[] totalIndsSoFar
-
totalIndsThisGen
public long[] totalIndsThisGen
-
totalSizeThisGen
public long[] totalSizeThisGen
-
totalFitnessThisGen
public double[] totalFitnessThisGen
-
bestOfGeneration
public Individual[] bestOfGeneration
-
lastTime
public long lastTime
-
-
Method Detail
-
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
-
getBestSoFar
public Individual[] getBestSoFar()
-
preInitializationStatistics
public void preInitializationStatistics(EvolutionState state)
Description copied from class:StatisticsCalled immediately before population initialization occurs.- Overrides:
preInitializationStatisticsin classStatistics
-
postInitializationStatistics
public void postInitializationStatistics(EvolutionState state)
Description copied from class:StatisticsGENERATIONAL: Called immediately after population initialization occurs.- Overrides:
postInitializationStatisticsin classStatistics
-
preBreedingStatistics
public void preBreedingStatistics(EvolutionState state)
Description copied from class:StatisticsGENERATIONAL: Called immediately before breeding occurs.- Overrides:
preBreedingStatisticsin classStatistics
-
postBreedingStatistics
public void postBreedingStatistics(EvolutionState state)
Description copied from class:StatisticsGENERATIONAL: Called immediately after breeding occurs.- Overrides:
postBreedingStatisticsin classStatistics
-
preEvaluationStatistics
public void preEvaluationStatistics(EvolutionState state)
Description copied from class:StatisticsGENERATIONAL: Called immediately before evaluation occurs.- Overrides:
preEvaluationStatisticsin classStatistics
-
postEvaluationStatistics
public void postEvaluationStatistics(EvolutionState state)
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
-
-
DMelt 3.0 © DataMelt by jWork.ORG