Class NSGAII

All Implemented Interfaces:
Extensible, Algorithm, Configurable, EpsilonBoxEvolutionaryAlgorithm, EvolutionaryAlgorithm, Stateful
Direct Known Subclasses:
EpsilonNSGAII, NSGAIII

public class NSGAII extends AbstractEvolutionaryAlgorithm implements EpsilonBoxEvolutionaryAlgorithm
Implementation of NSGA-II, with the ability to attach an optional ε-dominance archive.

References:

  1. Deb, K. et al. "A Fast Elitist Multi-Objective Genetic Algorithm: NSGA-II." IEEE Transactions on Evolutionary Computation, 6:182-197, 2000.
  2. 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.
  • Constructor Details

    • NSGAII

      public NSGAII(Problem problem)
      Constructs the NSGA-II algorithm with default settings.
      Parameters:
      problem - the problem being solved
    • NSGAII

      public NSGAII(Problem problem, int initialPopulationSize, NondominatedSortingPopulation population, EpsilonBoxDominanceArchive archive, Selection selection, Variation variation, Initialization initialization)
      Constructs the NSGA-II algorithm with the specified components.
      Parameters:
      problem - the problem being solved
      initialPopulationSize - the initial population size
      population - the population used to store solutions
      archive - the archive used to store the result; can be null
      selection - the selection operator
      variation - the variation operator
      initialization - the initialization method
  • Method Details

    • 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
    • setVariation

      public void setVariation(Variation variation)
      Description copied from class: AbstractEvolutionaryAlgorithm
      Replaces the variation operator to be used by this algorithm.
      Overrides:
      setVariation in class AbstractEvolutionaryAlgorithm
      Parameters:
      variation - the variation operator
    • setInitialPopulationSize

      public void setInitialPopulationSize(int initialPopulationSize)
      Description copied from class: AbstractEvolutionaryAlgorithm
      Sets the initial population size. This value can not be set after initialization.
      Overrides:
      setInitialPopulationSize in class AbstractEvolutionaryAlgorithm
      Parameters:
      initialPopulationSize - the initial population size
    • getArchive

      public EpsilonBoxDominanceArchive 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 EpsilonBoxEvolutionaryAlgorithm
      Specified by:
      getArchive in interface EvolutionaryAlgorithm
      Overrides:
      getArchive in class AbstractEvolutionaryAlgorithm
      Returns:
      the current non-dominated archive of the best solutions generated by this evolutionary algorithm, or null if no archive is used
    • setArchive

      public void setArchive(EpsilonBoxDominanceArchive archive)
      Sets the archive used by this algorithm. This value can not be set after initialization.
      Parameters:
      archive - the archive
    • getPopulation

      public NondominatedSortingPopulation getPopulation()
      Description copied from interface: EvolutionaryAlgorithm
      Returns the current population of this evolutionary algorithm.
      Specified by:
      getPopulation in interface EvolutionaryAlgorithm
      Overrides:
      getPopulation in class AbstractEvolutionaryAlgorithm
      Returns:
      the current population of this evolutionary algorithm
    • applyConfiguration

      public void applyConfiguration(TypedProperties properties)
      Description copied from interface: Configurable
      Applies the properties to this instance. It is strongly recommended to apply a configuration immediately after creating the instance, as some properties can not be changed after the class is used. Exceptions may be thrown if attempting to set such properties. After calling this method, we encourage users to call TypedProperties.warnIfUnaccessedProperties() to verify all properties were processed. This can identify simple mistakes like typos. If overriding this method, properties should only be updated if a new value is provided. Additionally, if updating any Configurable objects inside this object, they should be updated before calling super.applyConfiguration(properties).
      Specified by:
      applyConfiguration in interface Configurable
      Parameters:
      properties - the user-defined properties
    • getConfiguration

      public TypedProperties getConfiguration()
      Description copied from interface: Configurable
      Gets the current configuration of this instance. In theory, these properties should be able to create a duplicate instance. Note however, they are unlikely to behave identically due to random numbers and other transient fields.
      Specified by:
      getConfiguration in interface Configurable
      Returns:
      the properties defining this instance