ec.evolve
Class RandomRestarts
- java.lang.Object
-
- ec.Statistics
-
- ec.evolve.RandomRestarts
-
public class RandomRestarts extends Statistics
A special Statistics class which performs random restarts on the population, effectively reininitializing the population and starting over again. RandomRestarts has two ways of determining when to perform a restart. If the restart type is "fixed", then the restart will occur precisely when the generation is a multiple of restart-upper-bound, minus one. (That's hardly random, of course). If the restart type is "random", then at the beginning of the run, and after every restart, a new restart is chosen randomly from one to restart-upper-bound.This class is compatible with populations which load from files -- it temporarily disables the load-from-file feature when telling the population to populate itself again, forcing the population to do so by creating random individuals.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description intcountdownstatic java.lang.StringP_RESTART_TYPEstatic java.lang.StringP_RESTART_UPPERBOUNDstatic java.lang.StringP_STARTintstartintupperbound-
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 RandomRestarts()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidpreEvaluationStatistics(EvolutionState state)Checks the clock; if it's time to restart, we repopulate the population.voidsetup(EvolutionState state, Parameter base)Gets the clock ticking.-
Methods inherited from class ec.Statistics
enteringInitialPopulationStatistics, enteringSteadyStateStatistics, finalStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postBreedingStatistics, postCheckpointStatistics, postEvaluationStatistics, postInitializationStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preBreedingStatistics, preCheckpointStatistics, preInitializationStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics
-
-
-
-
Field Detail
-
P_RESTART_TYPE
public static final java.lang.String P_RESTART_TYPE
- See Also:
- Constant Field Values
-
P_RESTART_UPPERBOUND
public static final java.lang.String P_RESTART_UPPERBOUND
- See Also:
- Constant Field Values
-
P_START
public static final java.lang.String P_START
- See Also:
- Constant Field Values
-
countdown
public int countdown
-
upperbound
public int upperbound
-
start
public int start
-
-
Method Detail
-
setup
public void setup(EvolutionState state, Parameter base)
Gets the clock ticking.- Specified by:
setupin interfaceSetup- Overrides:
setupin classStatistics
-
preEvaluationStatistics
public void preEvaluationStatistics(EvolutionState state)
Checks the clock; if it's time to restart, we repopulate the population. Afterwards, we reset the clock. If it's not time yet, the clock goes tick.- Overrides:
preEvaluationStatisticsin classStatistics
-
-
DMelt 3.0 © DataMelt by jWork.ORG