Class AdaptiveTimeContinuation
java.lang.Object
org.moeaframework.core.PeriodicAction
org.moeaframework.algorithm.continuation.AdaptiveTimeContinuation
- All Implemented Interfaces:
Extensible
,Algorithm
,Configurable
,EvolutionaryAlgorithm
,Stateful
- Direct Known Subclasses:
EpsilonProgressContinuation
@Deprecated
public class AdaptiveTimeContinuation
extends PeriodicAction
implements EvolutionaryAlgorithm, Configurable
Deprecated.
Decorator for
EvolutionaryAlgorithm
s to add time continuation (restarts). Restarts occur if either
- the number of fitness function evaluations since the last restart exceeds
maxWindowSize
; or - the population-to-archive ratio exceeds
populationRatio
by more than25%
.
populationRatio
, the the new population is filled with solutions selected from
algorithm.getArchive()
and mutated using the specified Selection
and Variation
operators.
References:
- Goldberg, D. E. "Sizing Populations for Serial and Parallel Genetic Algorithms." In 3rd International Conference on Genetic Algorithms, pp. 70-79, 1989.
- Srivastava, R. P. "Time Continuation in Genetic Algorithms." Technical report, Illinois Genetic Algorithm Laboratory, 2002.
- Kollat, J. B., and Reed, P. M. "Comparison of Multi-Objective Evolutionary Algorithms for Long-Term Monitoring Design." Advances in Water Resources, 29(6):792-807, 2006.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.moeaframework.core.PeriodicAction
PeriodicAction.FrequencyType
-
Field Summary
Fields inherited from class org.moeaframework.core.PeriodicAction
algorithm, frequency, frequencyType, iteration, lastInvocation
-
Constructor Summary
ConstructorDescriptionAdaptiveTimeContinuation
(EvolutionaryAlgorithm algorithm, int windowSize, int maxWindowSize, double injectionRate, int minimumPopulationSize, int maximumPopulationSize, Selection restartSelection, Variation restartVariation) Deprecated.Decorates the specified algorithm with adaptive time continuation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRestartListener
(RestartListener listener) Deprecated.Adds a listener to be notified whenever a restart occurs.protected RestartType
check()
Deprecated.Performs a check to determine if a restart should occur.void
doAction()
Deprecated.Invoked periodically by this class to perform some function.protected EvolutionaryAlgorithm
Deprecated.Returns the algorithm that is wrapped by this periodic action.Deprecated.Returns the current non-dominated archive of the best solutions generated by this evolutionary algorithm, ornull
if no archive is used.double
Deprecated.Returns the percentage of the population that, during a restart, are introduced into the new population.int
Deprecated.Returns the maximum size of the population.int
Deprecated.Returns the maximum number of iterations allowed since the last restart before forcing a restart.int
Deprecated.Returns the minimum size of the population.Deprecated.Returns the current population of this evolutionary algorithm.int
Deprecated.Returns the number of iterations between invocations ofcheck
.void
loadState
(ObjectInputStream stream) Deprecated.Loads the state of this object from the stream.void
removeRestartListener
(RestartListener listener) Deprecated.Removes the specified listener so it no longer receives notifications whenever a restart occurs.protected void
restart
(RestartType type) Deprecated.Performs a restart.void
saveState
(ObjectOutputStream stream) Deprecated.Writes the state of this object to the stream.void
setInjectionRate
(double injectionRate) Deprecated.Sets the percentage of the population that, during a restart, are introduced into the new population.void
setMaximumPopulationSize
(int maximumPopulationSize) Deprecated.Sets the maximum size of the population.void
setMaxWindowSize
(int maxWindowSize) Deprecated.Sets the maximum number of iterations allowed since the last restart before forcing a restart.void
setMinimumPopulationSize
(int minimumPopulationSize) Deprecated.Sets the minimum size of the population.void
setWindowSize
(int windowSize) Deprecated.Sets the number of iterations between invocations ofcheck
.Methods inherited from class org.moeaframework.core.PeriodicAction
evaluate, getExtensions, getNumberOfEvaluations, getProblem, getResult, initialize, isInitialized, isTerminated, step, terminate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.core.Algorithm
evaluate, evaluateAll, evaluateAll, getNumberOfEvaluations, getProblem, getResult, initialize, isInitialized, isTerminated, run, run, step, terminate
Methods inherited from interface org.moeaframework.core.configuration.Configurable
applyConfiguration, getConfiguration
Methods inherited from interface org.moeaframework.algorithm.extension.Extensible
addExtension, getExtensions, removeExtension
-
Constructor Details
-
AdaptiveTimeContinuation
public AdaptiveTimeContinuation(EvolutionaryAlgorithm algorithm, int windowSize, int maxWindowSize, double injectionRate, int minimumPopulationSize, int maximumPopulationSize, Selection restartSelection, Variation restartVariation) Deprecated.Decorates the specified algorithm with adaptive time continuation.- Parameters:
algorithm
- the algorithm being decoratedwindowSize
- the number of iterations between invocations ofcheck
maxWindowSize
- the maximum number of iterations allowed since the last restart before forcing a restartinjectionRate
- the injection rate percentageminimumPopulationSize
- the minimum size of the populationmaximumPopulationSize
- the maximum size of the populationrestartSelection
- the selection operator for selecting solutions from the archive during a restartrestartVariation
- the variation operator for mutating solutions selected from the archive during a restart
-
-
Method Details
-
getWindowSize
public int getWindowSize()Deprecated.Returns the number of iterations between invocations ofcheck
.- Returns:
- the window size, in iterations
-
setWindowSize
public void setWindowSize(int windowSize) Deprecated.Sets the number of iterations between invocations ofcheck
.- Parameters:
windowSize
- the window size, in iterations
-
getMaxWindowSize
public int getMaxWindowSize()Deprecated.Returns the maximum number of iterations allowed since the last restart before forcing a restart.- Returns:
- the maximum window size, in iterations
-
setMaxWindowSize
public void setMaxWindowSize(int maxWindowSize) Deprecated.Sets the maximum number of iterations allowed since the last restart before forcing a restart.- Parameters:
maxWindowSize
- the maximum window size, in iterations
-
getInjectionRate
public double getInjectionRate()Deprecated.Returns the percentage of the population that, during a restart, are introduced into the new population.- Returns:
- the injection rate
-
setInjectionRate
public void setInjectionRate(double injectionRate) Deprecated.Sets the percentage of the population that, during a restart, are introduced into the new population. The population will be resized to holdarchive.size() / injectionRate
solutions.- Parameters:
injectionRate
- the injection rate
-
getMinimumPopulationSize
public int getMinimumPopulationSize()Deprecated.Returns the minimum size of the population.- Returns:
- the minimum size of the population
-
setMinimumPopulationSize
public void setMinimumPopulationSize(int minimumPopulationSize) Deprecated.Sets the minimum size of the population.- Parameters:
minimumPopulationSize
- the minimum size of the population
-
getMaximumPopulationSize
public int getMaximumPopulationSize()Deprecated.Returns the maximum size of the population.- Returns:
- the maximum size of the population
-
setMaximumPopulationSize
public void setMaximumPopulationSize(int maximumPopulationSize) Deprecated.Sets the maximum size of the population.- Parameters:
maximumPopulationSize
- the maximum size of the population
-
addRestartListener
Deprecated.Adds a listener to be notified whenever a restart occurs.- Parameters:
listener
- the listener to be notified whenever a restart occurs
-
removeRestartListener
Deprecated.Removes the specified listener so it no longer receives notifications whenever a restart occurs.- Parameters:
listener
- the listener to be removed
-
check
Deprecated.Performs a check to determine if a restart should occur. ReturnsRestartType.NONE
if no restart should occur; orRestartType.HARD
if the population-to-archive ratio exceedspopulationRatio
by more than25%
or the number of fitness evaluations since the last restart exceedsmaxWindowSize
.- Returns:
RestartType.NONE
if no restart should occur; orRestartType.HARD
if the population-to-archive ratio exceedspopulationRatio
by more than25%
or if the number of fitness evaluations since the last restart exceedsmaxWindowSize
-
restart
Deprecated.Performs a restart. If the type isRestartType.HARD
, the population is emptied, resized and filled with solutions selected and mutated from the archive. If the type isRestartType.SOFT
, the population is not emptied; new solutions are only added to fill any empty slots.- Parameters:
type
- the type of restart
-
doAction
public void doAction()Deprecated.Description copied from class:PeriodicAction
Invoked periodically by this class to perform some function. This function should not depend on the frequency that it is invoked, since it is not guaranteed that this method is invoked at any specific frequency and, in some cases, may not be invoked at all.- Specified by:
doAction
in classPeriodicAction
-
getAlgorithm
Deprecated.Description copied from class:PeriodicAction
Returns the algorithm that is wrapped by this periodic action.- Overrides:
getAlgorithm
in classPeriodicAction
- Returns:
- the inner algorithm
-
getPopulation
Deprecated.Description copied from interface:EvolutionaryAlgorithm
Returns the current population of this evolutionary algorithm.- Specified by:
getPopulation
in interfaceEvolutionaryAlgorithm
- Returns:
- the current population of this evolutionary algorithm
-
getArchive
Deprecated.Description copied from interface:EvolutionaryAlgorithm
Returns the current non-dominated archive of the best solutions generated by this evolutionary algorithm, ornull
if no archive is used.- Specified by:
getArchive
in interfaceEvolutionaryAlgorithm
- Returns:
- the current non-dominated archive of the best solutions generated by this evolutionary algorithm,
or
null
if no archive is used
-
saveState
Deprecated.Description copied from interface:Stateful
Writes the state of this object to the stream. The order that objects are written to the stream is important. We recommend first callingsuper.saveState(stream)
followed by writing each field.- Specified by:
saveState
in interfaceStateful
- Overrides:
saveState
in classPeriodicAction
- Parameters:
stream
- the stream- Throws:
IOException
- if an I/O error occurred
-
loadState
Deprecated.Description copied from interface:Stateful
Loads the state of this object from the stream. The order for reading objects from the stream must match the order they are written to the stream inStateful.saveState(ObjectOutputStream)
.- Specified by:
loadState
in interfaceStateful
- Overrides:
loadState
in classPeriodicAction
- Parameters:
stream
- the stream- Throws:
IOException
- if an I/O error occurredClassNotFoundException
- if the stream referenced a class that is not defined
-
AdaptiveTimeContinuationExtension
instead