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
TheDiversityIntegerEuclidean
is an implementation of theDiversityInteger
that calculates the diversity of twoIntegerGenotype
objects 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 double
diversity(IntegerGenotype a, IntegerGenotype b)
Returns the genetic diversity of twoGenotype
s.
-
-
-
Method Detail
-
diversity
public double diversity(IntegerGenotype a, IntegerGenotype b)
Description copied from interface:Diversity
Returns the genetic diversity of twoGenotype
s.- Specified by:
diversity
in interfaceDiversity<IntegerGenotype>
- Parameters:
a
- the first genotypeb
- the second genotype- Returns:
- the diversity of two genotypes
-
-