Class AEvolutionaryAlgorithm

  • All Implemented Interfaces:
    org.moeaframework.core.Algorithm, org.moeaframework.core.EvolutionaryAlgorithm
    Direct Known Subclasses:
    NSGAII

    public abstract class AEvolutionaryAlgorithm
    extends AbstractAlgorithm
    implements org.moeaframework.core.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

      Fields 
      Modifier and Type Field Description
      protected org.moeaframework.core.NondominatedPopulation archive
      The archive storing the non-dominated solutions.
      protected org.moeaframework.core.Initialization initialization
      The initialization operator.
      protected org.moeaframework.core.Population population
      The current population.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AEvolutionaryAlgorithm​(org.moeaframework.core.Problem problem, org.moeaframework.core.Population population, org.moeaframework.core.NondominatedPopulation archive, org.moeaframework.core.Initialization initialization)
      Constructs an abstract evolutionary algorithm.
    • Field Detail

      • population

        protected final org.moeaframework.core.Population population
        The current population.
      • archive

        protected final org.moeaframework.core.NondominatedPopulation archive
        The archive storing the non-dominated solutions.
      • initialization

        protected final org.moeaframework.core.Initialization initialization
        The initialization operator.
    • Constructor Detail

      • AEvolutionaryAlgorithm

        protected AEvolutionaryAlgorithm​(org.moeaframework.core.Problem problem,
                                         org.moeaframework.core.Population population,
                                         org.moeaframework.core.NondominatedPopulation archive,
                                         org.moeaframework.core.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 org.moeaframework.core.NondominatedPopulation getResult()
        Specified by:
        getResult in interface org.moeaframework.core.Algorithm
      • 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 org.moeaframework.core.NondominatedPopulation getArchive()
        Specified by:
        getArchive in interface org.moeaframework.core.EvolutionaryAlgorithm
      • getPopulation

        public org.moeaframework.core.Population getPopulation()
        Specified by:
        getPopulation in interface org.moeaframework.core.EvolutionaryAlgorithm
      • getState

        public java.io.Serializable getState()
                                      throws java.io.NotSerializableException
        Specified by:
        getState in interface org.moeaframework.core.Algorithm
        Overrides:
        getState in class AbstractAlgorithm
        Throws:
        java.io.NotSerializableException
      • setState

        public void setState​(java.lang.Object objState)
                      throws java.io.NotSerializableException
        Specified by:
        setState in interface org.moeaframework.core.Algorithm
        Overrides:
        setState in class AbstractAlgorithm
        Throws:
        java.io.NotSerializableException