Package org.opt4j.operator.diversity
Class DiversityIntegerEuclidean
- java.lang.Object
-
- org.opt4j.operator.diversity.DiversityIntegerEuclidean
-
- All Implemented Interfaces:
Operator<IntegerGenotype>,Diversity<IntegerGenotype>,DiversityInteger
public class DiversityIntegerEuclidean extends Object implements DiversityInteger
TheDiversityIntegerEuclideanis an implementation of theDiversityIntegerthat calculates the diversity of twoIntegerGenotypeobjects by normalizing the values to[0,1]and calculating the Euclidean distance.
-
-
Constructor Summary
Constructors Constructor Description DiversityIntegerEuclidean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublediversity(IntegerGenotype a, IntegerGenotype b)Returns the genetic diversity of twoGenotypes.
-
-
-
Method Detail
-
diversity
public double diversity(IntegerGenotype a, IntegerGenotype b)
Description copied from interface:DiversityReturns the genetic diversity of twoGenotypes.- Specified by:
diversityin interfaceDiversity<IntegerGenotype>- Parameters:
a- the first genotypeb- the second genotype- Returns:
- the diversity of two genotypes
-
-