Class NonDominatedFronts


  • public class NonDominatedFronts
    extends java.lang.Object
    The NonDominatedFronts sorts each evaluated Individual into fronts based on the number of other individuals it is dominated by. The first front consists of points that are not dominated at all and so on.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<java.util.Collection<org.opt4j.core.Individual>> fronts  
    • Constructor Summary

      Constructors 
      Constructor Description
      NonDominatedFronts​(java.util.Collection<org.opt4j.core.Individual> individuals)
      Creates the NonDominatedFronts for the given collection of Individuals.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void determineDomination​(java.util.Collection<org.opt4j.core.Individual> individuals, java.util.Map<org.opt4j.core.Individual,​java.util.List<org.opt4j.core.Individual>> dominatedIndividualsMap, int[] dominatingIndividualNumber, java.util.Map<org.opt4j.core.Individual,​java.lang.Integer> individual2IndexMap)
      Compares all possible Individual pairs.
      protected java.util.List<java.util.Collection<org.opt4j.core.Individual>> generateFronts​(java.util.Collection<org.opt4j.core.Individual> individuals)
      Sorts the given Individuals into non-dominated fronts.
      java.util.Collection<org.opt4j.core.Individual> getFrontAtIndex​(int index)
      Returns the front at the specified index.
      int getFrontNumber()
      Returns the number of non-dominated fronts.
      protected java.util.List<org.opt4j.core.Individual> getNextFront​(java.util.List<org.opt4j.core.Individual> currentFront, java.util.Map<org.opt4j.core.Individual,​java.util.List<org.opt4j.core.Individual>> dominatedIndividualsMap, int[] dominatingIndividualNumber, java.util.Map<org.opt4j.core.Individual,​java.lang.Integer> individual2IndexMap)
      Finds the next non-dominated front by processing the current non-dominated front.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fronts

        protected final java.util.List<java.util.Collection<org.opt4j.core.Individual>> fronts
    • Constructor Detail

      • NonDominatedFronts

        public NonDominatedFronts​(java.util.Collection<org.opt4j.core.Individual> individuals)
        Creates the NonDominatedFronts for the given collection of Individuals.
        Parameters:
        individuals - the Individuals that are sorted into non dominated fronts
    • Method Detail

      • generateFronts

        protected java.util.List<java.util.Collection<org.opt4j.core.Individual>> generateFronts​(java.util.Collection<org.opt4j.core.Individual> individuals)
        Sorts the given Individuals into non-dominated fronts.
        Parameters:
        individuals - the collection of Individuals that shall be sorted
        Returns:
        the non-dominated fronts
      • getFrontAtIndex

        public java.util.Collection<org.opt4j.core.Individual> getFrontAtIndex​(int index)
        Returns the front at the specified index.
        Parameters:
        index - the specified index
        Returns:
        the front at the specified index
      • getFrontNumber

        public int getFrontNumber()
        Returns the number of non-dominated fronts.
        Returns:
        the number of non-dominated fronts
      • getNextFront

        protected java.util.List<org.opt4j.core.Individual> getNextFront​(java.util.List<org.opt4j.core.Individual> currentFront,
                                                                         java.util.Map<org.opt4j.core.Individual,​java.util.List<org.opt4j.core.Individual>> dominatedIndividualsMap,
                                                                         int[] dominatingIndividualNumber,
                                                                         java.util.Map<org.opt4j.core.Individual,​java.lang.Integer> individual2IndexMap)
        Finds the next non-dominated front by processing the current non-dominated front. The Individuals found therein are removed from consideration. The individuals that are then not dominated form the next non-dominated front.
        Parameters:
        currentFront - the list of individuals forming the current non-dominated front
        dominatedIndividualsMap - map mapping an individual on the collection of individuals that it dominates
        dominatingIndividualNumber - an array where the number of dominating individuals is stored for each individual
        individual2IndexMap - a map storing the indices of the individuals used to access the dominatingIndividualNumber
        Returns:
        the list of individuals forming the next non-dominated front
      • determineDomination

        protected void determineDomination​(java.util.Collection<org.opt4j.core.Individual> individuals,
                                           java.util.Map<org.opt4j.core.Individual,​java.util.List<org.opt4j.core.Individual>> dominatedIndividualsMap,
                                           int[] dominatingIndividualNumber,
                                           java.util.Map<org.opt4j.core.Individual,​java.lang.Integer> individual2IndexMap)
        Compares all possible Individual pairs. For each individual, stores 1) the number of individuals it is dominated by and 2) the set of individuals it dominates.
        Parameters:
        individuals - a collection of individuals
        dominatedIndividualsMap - A map that is filled during the execution of the method. Each individual is mapped onto the set of individuals that are dominated by this individual.
        dominatingIndividualNumber - An integer array (initialized with zeros) that is filled during the execution of this method. Each individual is associated with an entry of this array. The integer therein is the number of individuals this individual is dominated by.
        individual2IndexMap - a map mapping each individual onto its index in the dominatingIndividualNumber - array