MOEA Framework 2.12
API Specification

org.moeaframework.algorithm
Class AdaptiveTimeContinuation

java.lang.Object
  extended by org.moeaframework.algorithm.PeriodicAction
      extended by org.moeaframework.algorithm.AdaptiveTimeContinuation
All Implemented Interfaces:
Algorithm, EvolutionaryAlgorithm
Direct Known Subclasses:
EpsilonProgressContinuation

public class AdaptiveTimeContinuation
extends PeriodicAction
implements EvolutionaryAlgorithm

Decorator for EvolutionaryAlgorithms to add time continuation (restarts). Restarts occur if either

  1. the number of fitness function evaluations since the last restart exceeds maxWindowSize; or
  2. the population-to-archive ratio exceeds populationRatio by more than 25%.
If a restart occurs, the population is emptied, the population size is adapted to maintain the populationRatio, the the new population is filled with solutions selected from algorithm.getArchive() and mutated using the specified Selection and Variation operators.

References:

  1. Goldberg, D. E. "Sizing Populations for Serial and Parallel Genetic Algorithms." In 3rd International Conference on Genetic Algorithms, pp. 70-79, 1989.
  2. Srivastava, R. P. "Time Continuation in Genetic Algorithms." Technical report, Illinois Genetic Algorithm Laboratory, 2002.
  3. 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.algorithm.PeriodicAction
PeriodicAction.FrequencyType
 
Field Summary
 
Fields inherited from class org.moeaframework.algorithm.PeriodicAction
algorithm, frequency, frequencyType, iteration, lastInvocation
 
Constructor Summary
AdaptiveTimeContinuation(EvolutionaryAlgorithm algorithm, int windowSize, int maxWindowSize, double populationRatio, int minimumPopulationSize, int maximumPopulationSize, Selection selection, Variation variation)
          Decorates the specified algorithm with adaptive time continuation.
 
Method Summary
 void addRestartListener(RestartListener listener)
          Adds a listener to be notified whenever a restart occurs.
protected  RestartType check()
          Performs a check to determine if a restart should occur.
 void doAction()
          Invoked periodically by this class to perform some function.
 NondominatedPopulation getArchive()
          Returns the current non-dominated archive of the best solutions generated by this evolutionary algorithm, or null if no archive is used.
 Population getPopulation()
          Returns the current population of this evolutionary algorithm.
 Serializable getState()
          Returns a Serializable object representing the internal state of this algorithm.
 void removeRestartListener(RestartListener listener)
          Removes the specified listener so it no longer receives notifications whenever a restart occurs.
protected  void restart(RestartType type)
          Performs a restart.
 void setState(Object objState)
          Sets the internal state of of this algorithm.
 
Methods inherited from class org.moeaframework.algorithm.PeriodicAction
evaluate, getNumberOfEvaluations, getProblem, getResult, 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, getNumberOfEvaluations, getProblem, getResult, isTerminated, step, terminate
 

Constructor Detail

AdaptiveTimeContinuation

public AdaptiveTimeContinuation(EvolutionaryAlgorithm algorithm,
                                int windowSize,
                                int maxWindowSize,
                                double populationRatio,
                                int minimumPopulationSize,
                                int maximumPopulationSize,
                                Selection selection,
                                Variation variation)
Decorates the specified algorithm with adaptive time continuation.

Parameters:
algorithm - the algorithm being decorated
windowSize - the number of iterations between invocations of check
maxWindowSize - the maximum number of iterations allowed since the last restart before forcing a restart
populationRatio - the population-to-archive ratio
minimumPopulationSize - the minimum size of the population
maximumPopulationSize - the maximum size of the population
selection - the selection operator for selecting solutions from the archive during a restart
variation - the variation operator for mutating solutions selected from the archive during a restart
Method Detail

addRestartListener

public void addRestartListener(RestartListener listener)
Adds a listener to be notified whenever a restart occurs.

Parameters:
listener - the listener to be notified whenever a restart occurs

removeRestartListener

public void removeRestartListener(RestartListener listener)
Removes the specified listener so it no longer receives notifications whenever a restart occurs.

Parameters:
listener - the listener to be removed

check

protected RestartType check()
Performs a check to determine if a restart should occur. Returns RestartType.NONE if no restart should occur; or RestartType.HARD if the population-to-archive ratio exceeds populationRatio by more than 25% or the number of fitness evaluations since the last restart exceeds maxWindowSize.

Returns:
RestartType.NONE if no restart should occur; or RestartType.HARD if the population-to-archive ratio exceeds populationRatio by more than 25% or if the number of fitness evaluations since the last restart exceeds maxWindowSize

restart

protected void restart(RestartType type)
Performs a restart. If the type is RestartType.HARD, the population is emptied, resized and filled with solutions selected and mutated from the archive. If the type is RestartType.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()
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 class PeriodicAction

getPopulation

public Population getPopulation()
Description copied from interface: EvolutionaryAlgorithm
Returns the current population of this evolutionary algorithm.

Specified by:
getPopulation in interface EvolutionaryAlgorithm
Returns:
the current population of this evolutionary algorithm

getArchive

public NondominatedPopulation getArchive()
Description copied from interface: EvolutionaryAlgorithm
Returns the current non-dominated archive of the best solutions generated by this evolutionary algorithm, or null if no archive is used.

Specified by:
getArchive in interface EvolutionaryAlgorithm
Returns:
the current non-dominated archive of the best solutions generated by this evolutionary algorithm, or null if no archive is used

getState

public Serializable getState()
                      throws NotSerializableException
Description copied from interface: Algorithm
Returns a Serializable object representing the internal state of this algorithm.

Specified by:
getState in interface Algorithm
Overrides:
getState in class PeriodicAction
Returns:
a Serializable object representing the internal state of this algorithm
Throws:
NotSerializableException - if this algorithm does not support serialization

setState

public void setState(Object objState)
              throws NotSerializableException
Description copied from interface: Algorithm
Sets the internal state of of this algorithm.

Specified by:
setState in interface Algorithm
Overrides:
setState in class PeriodicAction
Parameters:
objState - the internal state of this algorithm
Throws:
NotSerializableException - if this algorithm does not support serialization

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!