Class Statistics
- All Implemented Interfaces:
Setup,Singleton,Serializable
- Direct Known Subclasses:
ChartableStatistics,RandomRestarts,SimpleShortStatistics,SimpleStatistics,TarpeianStatistics
There are lots of places where statistics might be nice to print out. These places are implemented as hooks in the Statistics object which you can override if you like; otherwise they call the default behavior. If you plan on allowing your Statistics subclass to contain children, you should remember to call the appropriate super.foo() if you override any foo() method.
While there are lots of hooks, various EvolutionState objects only implement a subset of them. You'll need to look at the EvolutionState code to see which ones are implemented to make sure that your statistics hooks are called appropriately!
Statistics objects should set up their statistics logs etc. during setup(...). Remember to make the log restartable in case of restarting from a checkpoint.
Steady-State Statistics. For convenience, Statistics contains default implementations of the SteadyStateStatisticsForm methods but does not implement SteadyStateStatisticsForm. This mostly is intended to keep SteadyStateStatistcsForm implementations from having to call functions on all their children: instead they can just call foo.super();
Parameters
| base.num-children int >= 0 |
(number of child statistics objects) |
| base.child.n classname, inherits or equals ec.Statistics |
(the class of child statistics object number n) |
Parameter bases
| base.child.n | species (child statistics object number n) |
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSTEADY-STATE: called when we created an empty initial Population.voidenteringSteadyStateStatistics(int subpop, SteadyStateEvolutionState state) STEADY-STATE: called when a given Subpopulation is entering the Steady-State.voidfinalStatistics(EvolutionState state, int result) Called immediately after the run has completed.voidSTEADY-STATE: called each time the generation count incrementsvoidindividualsBredStatistics(SteadyStateEvolutionState state, Individual[] individuals) STEADY-STATE: called each time new individuals are bred during the steady-state process.voidindividualsEvaluatedStatistics(SteadyStateEvolutionState state, Individual[] newIndividuals, Individual[] oldIndividuals, int[] subpopulations, int[] indices) STEADY-STATE: called each time new individuals are evaluated during the steady-state process.voidGENERATIONAL: Called immediately after breeding occurs.voidCalled immediately after checkpointing occurs.voidGENERATIONAL: Called immediately after evaluation occurs.voidGENERATIONAL: Called immediately after population initialization occurs.voidCalled immediately after the post-breeding exchange occurs.voidCalled immediately after the pre-breeding exchange occurs.voidGENERATIONAL: Called immediately before breeding occurs.voidCalled immediately before checkpointing occurs.voidGENERATIONAL: Called immediately before evaluation occurs.voidCalled immediately before population initialization occurs.voidCalled immediately before the post-breeding exchange occurs.voidCalled immediately before the pre-breeding exchange 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.
-
Field Details
-
P_NUMCHILDREN
- See Also:
-
P_CHILD
- See Also:
-
P_SILENT
- See Also:
-
P_MUZZLE
- See Also:
-
P_SILENT_PRINT
- See Also:
-
P_SILENT_FILE
- See Also:
-
children
-
silentFile
public boolean silentFile -
silentPrint
public boolean silentPrint
-
-
Constructor Details
-
Statistics
public Statistics()
-
-
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. -
preInitializationStatistics
Called immediately before population initialization occurs. -
postInitializationStatistics
GENERATIONAL: Called immediately after population initialization occurs. -
preCheckpointStatistics
Called immediately before checkpointing occurs. -
postCheckpointStatistics
Called immediately after checkpointing occurs. -
preEvaluationStatistics
GENERATIONAL: Called immediately before evaluation occurs. -
postEvaluationStatistics
GENERATIONAL: Called immediately after evaluation occurs. -
prePreBreedingExchangeStatistics
Called immediately before the pre-breeding exchange occurs. -
postPreBreedingExchangeStatistics
Called immediately after the pre-breeding exchange occurs. -
preBreedingStatistics
GENERATIONAL: Called immediately before breeding occurs. -
postBreedingStatistics
GENERATIONAL: Called immediately after breeding occurs. -
prePostBreedingExchangeStatistics
Called immediately before the post-breeding exchange occurs. -
postPostBreedingExchangeStatistics
Called immediately after the post-breeding exchange occurs. -
finalStatistics
Called immediately after the run has completed. result is either state.R_FAILURE, indicating that an ideal individual was not found, or state.R_SUCCESS, indicating that an ideal individual was found. -
enteringInitialPopulationStatistics
STEADY-STATE: called when we created an empty initial Population. -
enteringSteadyStateStatistics
STEADY-STATE: called when a given Subpopulation is entering the Steady-State. -
individualsBredStatistics
STEADY-STATE: called each time new individuals are bred during the steady-state process. -
individualsEvaluatedStatistics
public void individualsEvaluatedStatistics(SteadyStateEvolutionState state, Individual[] newIndividuals, Individual[] oldIndividuals, int[] subpopulations, int[] indices) STEADY-STATE: called each time new individuals are evaluated during the steady-state process. You can look up the individuals in state.newIndividuals[] -
generationBoundaryStatistics
STEADY-STATE: called each time the generation count increments
-