public class Crowding extends Object implements FrontDensityIndicator
Crowding calculates the crowding distance of Individuals
as used for instance in the the Nsga2 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.| Constructor and Description |
|---|
Crowding() |
| Modifier and Type | Method and Description |
|---|---|
Map<Individual,Double> |
getDensityValues(Collection<Individual> individuals)
Returns the density values for a collection on
Individuals. |
List<Individual> |
order(Map<Individual,Double> values)
Returns an ordered list of the
Individuals corresponding to their
crowding distance. |
public List<Individual> order(Map<Individual,Double> values)
Individuals corresponding to their
crowding distance. Individuals with a high crowding distance are
sorted to the front.values - the map of individuals to their crowding distance valuespublic Map<Individual,Double> getDensityValues(Collection<Individual> individuals)
FrontDensityIndicatorIndividuals.getDensityValues in interface FrontDensityIndicatorindividuals - the individuals