Package org.opt4j.operator.diversity
Class DiversityBooleanFraction
- java.lang.Object
-
- org.opt4j.operator.diversity.DiversityBooleanFraction
-
- All Implemented Interfaces:
Operator<BooleanGenotype>
,Diversity<BooleanGenotype>
,DiversityBoolean
public class DiversityBooleanFraction extends Object implements DiversityBoolean
TheDiversityBooleanFraction
calculates theDiversity
between twoBooleanGenotype
s by calculating the fraction of different vector entries.
-
-
Constructor Summary
Constructors Constructor Description DiversityBooleanFraction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
diversity(BooleanGenotype a, BooleanGenotype b)
Returns the genetic diversity of twoGenotype
s.
-
-
-
Method Detail
-
diversity
public double diversity(BooleanGenotype a, BooleanGenotype b)
Description copied from interface:Diversity
Returns the genetic diversity of twoGenotype
s.- Specified by:
diversity
in interfaceDiversity<BooleanGenotype>
- Parameters:
a
- the first genotypeb
- the second genotype- Returns:
- the diversity of two genotypes
-
-