MOEA Framework 2.12
API Specification

org.moeaframework.algorithm.single
Class GeneticAlgorithm

java.lang.Object
  extended by org.moeaframework.algorithm.AbstractAlgorithm
      extended by org.moeaframework.algorithm.AbstractEvolutionaryAlgorithm
          extended by org.moeaframework.algorithm.single.GeneticAlgorithm
All Implemented Interfaces:
Algorithm, EvolutionaryAlgorithm

public class GeneticAlgorithm
extends AbstractEvolutionaryAlgorithm

Single-objective genetic algorithm (GA) implementation with elitism. A single elite individual is retained in each generation.

References:

  1. John Holland. "Adaptation in Natural and Artificial Systems." MIT Press, ISBN: 9780262082136.


Field Summary
 
Fields inherited from class org.moeaframework.algorithm.AbstractEvolutionaryAlgorithm
archive, initialization, population
 
Fields inherited from class org.moeaframework.algorithm.AbstractAlgorithm
initialized, numberOfEvaluations, problem, terminated
 
Constructor Summary
GeneticAlgorithm(Problem problem, AggregateObjectiveComparator comparator, Initialization initialization, Selection selection, Variation variation)
          Constructs a new instance of the genetic algorithm (GA).
 
Method Summary
 NondominatedPopulation getResult()
          Returns the current best-known result.
protected  void initialize()
          Performs any initialization that is required by this algorithm.
 void iterate()
          Performs one iteration of the algorithm.
 void setState(Object objState)
          Sets the internal state of of this algorithm.
 void updateEliteSolution()
          Update the elite solution.
 
Methods inherited from class org.moeaframework.algorithm.AbstractEvolutionaryAlgorithm
getArchive, getPopulation, getState
 
Methods inherited from class org.moeaframework.algorithm.AbstractAlgorithm
evaluate, evaluateAll, evaluateAll, finalize, getNumberOfEvaluations, getProblem, isInitialized, isTerminated, 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
 

Constructor Detail

GeneticAlgorithm

public GeneticAlgorithm(Problem problem,
                        AggregateObjectiveComparator comparator,
                        Initialization initialization,
                        Selection selection,
                        Variation variation)
Constructs a new instance of the genetic algorithm (GA).

Parameters:
problem - the problem
comparator - the aggregate objective comparator
initialization - the initialization method
selection - the selection operator
variation - the variation operator
Method Detail

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 AbstractEvolutionaryAlgorithm

iterate

public void iterate()
Description copied from class: AbstractAlgorithm
Performs one iteration of the algorithm. This method should be overridden by implementations to perform each logical iteration of the algorithm.

Specified by:
iterate in class AbstractAlgorithm

updateEliteSolution

public void updateEliteSolution()
Update the elite solution.


getResult

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

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

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