Class MSOPSRankedPopulation

java.lang.Object
org.moeaframework.core.Population
org.moeaframework.algorithm.MSOPSRankedPopulation
All Implemented Interfaces:
Iterable<Solution>, Stateful, Displayable, Formattable<Solution>

public class MSOPSRankedPopulation extends Population
Population implementing the ranking scheme used by the Multiple Single Objective Pareto Sampling (MSOPS) algorithm. Solutions are ranked with respect to T weight vectors based on two metrics --- the weighted min-max aggregate and the vector angle distance scaling (VADS) metric --- producing 2*T scores/rankings. The overall ranking of a solution is computed using a lexicographical ordering, where the best rank is given to the solution with the best individual ranking among the T weight vectors.

Three methods of constraint handling are described in the literature. In the original paper, [1], E. Hughes recommends ranking feasible and infeasible solutions separately and ensuring the ranking if worse for the infeasible solutions. In the published Matlab code, [2], E. Hughes penalizes the objective values based on the magnitude of the constraint violation. Lastly, in [3], E. Hughes states that the infeasible solutions are ranked in order by their aggregate constraint violation. Regardless of these differences, all three methods ensure the ranking is always worse for infeasible solutions. This implementation follows this practice by penalizing the scores based on the magnitude of the constraint violation (similar to [2]).

References:

  1. E. J. Hughes. "Multiple Single Objective Pareto Sampling." 2003 Congress on Evolutionary Computation, pp. 2678-2684.
  2. Matlab source code available from http://code.evanhughes.org/.
  3. E. J. Hughes. "MSOPS-II: A general-purpose many-objective optimizer." 2007 IEEE Congress on Evolutionary Computation, pp. 3944-3951.
  4. E. J. Hughes. "Evolutionary many-objective optimization: many once or one many." 2005 IEEE Congress on Evolutionary Computation, pp. 222-227.
  • Constructor Details

    • MSOPSRankedPopulation

      public MSOPSRankedPopulation(List<double[]> weights)
      Constructs an empty population that maintains the rank and attribute for its solutions using the MSOPS ranking method.
      Parameters:
      weights - the weight vectors
    • MSOPSRankedPopulation

      public MSOPSRankedPopulation(List<double[]> weights, Iterable<? extends Solution> iterable)
      Constructs a population initialized with the specified solutions that maintains the rank attribute for its solutions using the MSOPS ranking method.
      Parameters:
      weights - the weight vectors
      iterable - the solutions used to initialize this population
  • Method Details

    • add

      public boolean add(Solution solution)
      Description copied from class: Population
      Adds the specified solution to this population.
      Overrides:
      add in class Population
      Parameters:
      solution - the solution to be added
      Returns:
      true if the population was modified as a result of this method; false otherwise.
    • replace

      public void replace(int index, Solution solution)
      Description copied from class: Population
      Replaces the solution at the given index.
      Overrides:
      replace in class Population
      Parameters:
      index - the index to replace
      solution - the new solution
    • get

      public Solution get(int index)
      Description copied from class: Population
      Returns the solution at the specified index in this population.
      Overrides:
      get in class Population
      Parameters:
      index - the index of the solution to be returned
      Returns:
      the solution at the specified index
    • remove

      public void remove(int index)
      Description copied from class: Population
      Removes the solution at the specified index from this population.
      Overrides:
      remove in class Population
      Parameters:
      index - the index of the solution to be removed
    • remove

      public boolean remove(Solution solution)
      Description copied from class: Population
      Removes the specified solution from this population, if present.
      Overrides:
      remove in class Population
      Parameters:
      solution - the solution to be removed
      Returns:
      true if this population was modified as a result of this method; false otherwise
    • clear

      public void clear()
      Description copied from class: Population
      Removes all solutions from this population.
      Overrides:
      clear in class Population
    • iterator

      public Iterator<Solution> iterator()
      Description copied from class: Population
      Returns an iterator for accessing the solutions in this population.
      Specified by:
      iterator in interface Iterable<Solution>
      Overrides:
      iterator in class Population
    • sort

      public void sort(Comparator<? super Solution> comparator)
      Description copied from class: Population
      Sorts the solutions in this population using the specified comparator. Invocations of certain methods on this population may alter the ordering of solutions, so the get, remove and iteration methods should be called immediately after invoking this method.
      Overrides:
      sort in class Population
      Parameters:
      comparator - the comparator to be used for sorting
    • truncate

      public void truncate(int size, Comparator<? super Solution> comparator)
      Description copied from class: Population
      Sorts this population using the specified comparator and removes the last (maximum) solutions until this population's size is within the specified size.
      Overrides:
      truncate in class Population
      Parameters:
      size - the target population size after truncation
      comparator - the comparator to be used for truncation
    • truncate

      public void truncate(int size)
      Equivalent to calling truncate(size, new RankComparator()).
      Parameters:
      size - the target population size after truncation
    • getNumberOfWeights

      public int getNumberOfWeights()
      Returns the number of weight vectors.
      Returns:
      the number of weight vectors
    • findNearest

      public Population findNearest(int index, int size)
      Returns the neighborhood of solutions nearest to and including the given solution.
      Parameters:
      index - the index of the solution at the center of the neighborhood
      size - the size of the neighborhood
      Returns:
      the solutions in the neighborhood
    • update

      public void update()
      Updates the rank attribute of all solutions in this population using the MSOPS ranking method. This method will in general be called automatically when the population is modified. However, only changes made to this population can be tracked; changes made directly to the contained solutions will not be detected. Therefore, it may be necessary to invoke update() manually.
    • copy

      public MSOPSRankedPopulation copy()
      Description copied from class: Population
      Returns a copy of this population. This can be thought of as a "deep copy", which creates a copy of both the population itself and copies of the individual solutions in the population. Consequently, the returned copy is completely independent, such that any modifications to the contents or order will not impact the original.

      Since creating such a "deep copy" can be expensive, prefer using the constructor Population(Iterable) or Population.addAll(Iterable) whenever possible. These alternatives are useful when filtering or reordering the solutions, but the solutions themselves are left unchanged.

      Overrides:
      copy in class Population
      Returns:
      the copy of this population
    • saveState

      public void saveState(ObjectOutputStream stream) throws IOException
      Description copied from interface: Stateful
      Writes the state of this object to the stream. The order that objects are written to the stream is important. We recommend first calling super.saveState(stream) followed by writing each field.
      Specified by:
      saveState in interface Stateful
      Overrides:
      saveState in class Population
      Parameters:
      stream - the stream
      Throws:
      IOException - if an I/O error occurred
    • loadState

      public void loadState(ObjectInputStream stream) throws IOException, ClassNotFoundException
      Description copied from interface: Stateful
      Loads the state of this object from the stream. The order for reading objects from the stream must match the order they are written to the stream in Stateful.saveState(ObjectOutputStream).
      Specified by:
      loadState in interface Stateful
      Overrides:
      loadState in class Population
      Parameters:
      stream - the stream
      Throws:
      IOException - if an I/O error occurred
      ClassNotFoundException - if the stream referenced a class that is not defined