MOEA Framework 2.12
API Specification

org.moeaframework.algorithm
Class AbstractEvolutionaryAlgorithm

java.lang.Object
  extended by org.moeaframework.algorithm.AbstractAlgorithm
      extended by org.moeaframework.algorithm.AbstractEvolutionaryAlgorithm
All Implemented Interfaces:
Algorithm, EvolutionaryAlgorithm
Direct Known Subclasses:
DBEA, DifferentialEvolution, EpsilonMOEA, EvolutionStrategy, GDE3, GeneticAlgorithm, IBEA, MSOPS, NSGAII, PAES, PESA2, RVEA, SMSEMOA, SPEA2, VEGA

public abstract class AbstractEvolutionaryAlgorithm
extends AbstractAlgorithm
implements EvolutionaryAlgorithm

Abstract class providing default implementations for several EvolutionaryAlgorithm methods. Primarily, the initialize() method generates and evaluates the initial population, adding the solutions to the archive if available. The getResult() method returns the non-dominated solutions from the population and, if available, the archive. The majority of evolutionary algorithms should only need to override the AbstractAlgorithm.iterate() method.


Field Summary
protected  NondominatedPopulation archive
          The archive storing the non-dominated solutions.
protected  Initialization initialization
          The initialization operator.
protected  Population population
          The current population.
 
Fields inherited from class org.moeaframework.algorithm.AbstractAlgorithm
initialized, numberOfEvaluations, problem, terminated
 
Constructor Summary
AbstractEvolutionaryAlgorithm(Problem problem, Population population, NondominatedPopulation archive, Initialization initialization)
          Constructs an abstract evolutionary algorithm.
 
Method Summary
 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.
 NondominatedPopulation getResult()
          Returns the current best-known result.
 Serializable getState()
          Returns a Serializable object representing the internal state of this algorithm.
protected  void initialize()
          Performs any initialization that is required by this algorithm.
 void setState(Object objState)
          Sets the internal state of of this algorithm.
 
Methods inherited from class org.moeaframework.algorithm.AbstractAlgorithm
evaluate, evaluateAll, evaluateAll, finalize, getNumberOfEvaluations, getProblem, isInitialized, isTerminated, iterate, step, terminate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.moeaframework.core.Algorithm
evaluate, getNumberOfEvaluations, getProblem, isTerminated, step, terminate
 

Field Detail

population

protected final Population population
The current population.


archive

protected final NondominatedPopulation archive
The archive storing the non-dominated solutions.


initialization

protected final Initialization initialization
The initialization operator.

Constructor Detail

AbstractEvolutionaryAlgorithm

public AbstractEvolutionaryAlgorithm(Problem problem,
                                     Population population,
                                     NondominatedPopulation archive,
                                     Initialization initialization)
Constructs an abstract evolutionary algorithm.

Parameters:
problem - the problem being solved
population - the population
archive - the archive storing the non-dominated solutions
initialization - the initialization operator
Method Detail

getResult

public NondominatedPopulation getResult()
Description copied from interface: Algorithm
Returns the current best-known result.

Specified by:
getResult in interface Algorithm
Returns:
the current best-known result

initialize

protected void initialize()
Description copied from class: AbstractAlgorithm
Performs any initialization that is required by this algorithm. This method is called automatically by the first invocation of AbstractAlgorithm.step(), but may also be called manually prior to any invocations of step. Implementations should always invoke super.initialize() to ensure the hierarchy is initialized correctly.

Overrides:
initialize in class AbstractAlgorithm

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

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

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 AbstractAlgorithm
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 AbstractAlgorithm
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!