Class ReverseFitnessNormalizer
java.lang.Object
de.hybris.platform.warehousing.sourcing.fitness.normalize.impl.ReverseFitnessNormalizer
- All Implemented Interfaces:
FitnessNormalizer
Normalizes the fitness value by dividing it by the given total and multiplying by 100 to produce a percentage. Then
subtracting that percentage from 100 to produce a reverse value. This is useful for when a smaller fitness value
should be better than a large fitness value.
Example normalize(5.0, 20.0); means (100 - ((5.0 / 20.0) * 100)) = 75
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ReverseFitnessNormalizer
public ReverseFitnessNormalizer()
-
-
Method Details
-
normalize
Description copied from interface:FitnessNormalizerNormalize the fitness out of 100.- Specified by:
normalizein interfaceFitnessNormalizer- Parameters:
fitness- - the evaluated fitness value orDouble.NaNif undefinedtotal- - the sum of all evaluated fitness values for a given sourcing factor orDouble.NaNif undefined; must be greater than 0- Returns:
- the normalized fitness or zero if the fitness is
Double.NaN - Throws:
IllegalArgumentException
-