Package org.opt4j.optimizers.ea
Class NonDominatedFronts
- java.lang.Object
-
- org.opt4j.optimizers.ea.NonDominatedFronts
-
public class NonDominatedFronts extends java.lang.Object
TheNonDominatedFronts
sorts each evaluatedIndividual
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 theNonDominatedFronts
for the given collection ofIndividual
s.
-
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 possibleIndividual
pairs.protected java.util.List<java.util.Collection<org.opt4j.core.Individual>>
generateFronts(java.util.Collection<org.opt4j.core.Individual> individuals)
Sorts the givenIndividual
s 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.
-
-
-
Constructor Detail
-
NonDominatedFronts
public NonDominatedFronts(java.util.Collection<org.opt4j.core.Individual> individuals)
Creates theNonDominatedFronts
for the given collection ofIndividual
s.- Parameters:
individuals
- theIndividual
s 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 givenIndividual
s into non-dominated fronts.- Parameters:
individuals
- the collection ofIndividual
s 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. TheIndividual
s 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 frontdominatedIndividualsMap
- map mapping an individual on the collection of individuals that it dominatesdominatingIndividualNumber
- an array where the number of dominating individuals is stored for each individualindividual2IndexMap
- 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 possibleIndividual
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 individualsdominatedIndividualsMap
- 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
-
-