org.jgap
Class DefaultFitnessEvaluator
- java.lang.Object
-
- org.jgap.DefaultFitnessEvaluator
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, FitnessEvaluator, ICloneable
public class DefaultFitnessEvaluator extends java.lang.Object implements FitnessEvaluator, ICloneable, java.lang.Comparable
A default implementation of a fitness evaluator. This implementation is straight forward: a higher fitness value is seen as fitter.- Since:
- 1.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DefaultFitnessEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()intcompareTo(java.lang.Object a_other)booleanisFitter(double a_fitness_value1, double a_fitness_value2)Compares the first given fitness value with the second and returns true if the first one is greater than the second one.booleanisFitter(IChromosome a_chrom1, IChromosome a_chrom2)
-
-
-
Method Detail
-
isFitter
public boolean isFitter(double a_fitness_value1, double a_fitness_value2)Compares the first given fitness value with the second and returns true if the first one is greater than the second one. Otherwise returns false- Specified by:
isFitterin interfaceFitnessEvaluator- Parameters:
a_fitness_value1- first fitness valuea_fitness_value2- second fitness value- Returns:
- true: first fitness value greater than second
- Since:
- 2.0 (until 1.1: input types int)
-
isFitter
public boolean isFitter(IChromosome a_chrom1, IChromosome a_chrom2)
- Specified by:
isFitterin interfaceFitnessEvaluator
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfaceICloneable- Overrides:
clonein classjava.lang.Object- Returns:
- deep clone of this instance
- Since:
- 3.2
-
compareTo
public int compareTo(java.lang.Object a_other)
- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
a_other- sic- Returns:
- as always
- Since:
- 3.2
-
-
DMelt 3.0 © DataMelt by jWork.ORG