Package org.opt4j.optimizer.ea
Class Crowding
- java.lang.Object
-
- org.opt4j.optimizer.ea.Crowding
-
- All Implemented Interfaces:
FrontDensityIndicator
public class Crowding extends Object implements FrontDensityIndicator
TheCrowding
calculates the crowding distance ofIndividual
s as used for instance in the theNsga2
algorithm. A bounding box around each individual is defined and restricted by the neighboring individuals in each dimension. The crowding distance is the sum of the side-lengths of the bounding box. If an individual does not have neighbors on all sides, the crowding distance is maximal. A normalization in each dimension is applied.- See Also:
- "A fast and elitist multiobjective genetic algorithm : NSGA-II, K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan Evolutionary Computation, IEEETransactions on, vol. 6, no. 2, pp. 182-197, August 2002."
-
-
Constructor Summary
Constructors Constructor Description Crowding()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Individual,Double>
getDensityValues(Collection<Individual> individuals)
Returns the density values for a collection onIndividuals
.List<Individual>
order(Map<Individual,Double> values)
Returns an ordered list of theIndividual
s corresponding to their crowding distance.
-
-
-
Method Detail
-
order
public List<Individual> order(Map<Individual,Double> values)
Returns an ordered list of theIndividual
s corresponding to their crowding distance.Individual
s with a high crowding distance are sorted to the front.- Parameters:
values
- the map of individuals to their crowding distance values- Returns:
- the sorted list of individuals based on their crowding distance
-
getDensityValues
public Map<Individual,Double> getDensityValues(Collection<Individual> individuals)
Description copied from interface:FrontDensityIndicator
Returns the density values for a collection onIndividuals
.- Specified by:
getDensityValues
in interfaceFrontDensityIndicator
- Parameters:
individuals
- the individuals- Returns:
- a map of each individual to its density value
-
-