org.encog.ml.ea.sort
Interface GenomeComparator
-
- All Superinterfaces:
- java.util.Comparator<Genome>
- All Known Implementing Classes:
- AbstractGenomeComparator, MaximizeAdjustedScoreComp, MaximizeScoreComp, MinimizeAdjustedScoreComp, MinimizeScoreComp
public interface GenomeComparator extends java.util.Comparator<Genome>
Defines methods for comparing genomes. Also provides methods to apply bonuses and penalties.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description doubleapplyBonus(double value, double bonus)Apply a bonus, this is a simple percent that is applied in the direction specified by the "should minimize" property of the score function.doubleapplyPenalty(double value, double bonus)Apply a penalty, this is a simple percent that is applied in the direction specified by the "should minimize" property of the score function.booleanisBetterThan(double d1, double d2)Determine if one score is better than the other.booleanisBetterThan(Genome genome1, Genome genome2)Determine if one genome is better than the other genome.booleanshouldMinimize()-
Methods inherited from interface java.util.Comparator
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
applyBonus
double applyBonus(double value, double bonus)Apply a bonus, this is a simple percent that is applied in the direction specified by the "should minimize" property of the score function.- Parameters:
value- The current value.bonus- The bonus.- Returns:
- The resulting value.
-
applyPenalty
double applyPenalty(double value, double bonus)Apply a penalty, this is a simple percent that is applied in the direction specified by the "should minimize" property of the score function.- Parameters:
value- The current value.bonus- The penalty.- Returns:
- The resulting value.
-
isBetterThan
boolean isBetterThan(double d1, double d2)Determine if one score is better than the other.- Parameters:
d1- The first score to compare.d2- The second score to compare.- Returns:
- True if d1 is better than d2.
-
isBetterThan
boolean isBetterThan(Genome genome1, Genome genome2)
Determine if one genome is better than the other genome.- Parameters:
genome1- The first genome.genome2- The second genome.- Returns:
- True, if genome1 is better than genome2.
-
shouldMinimize
boolean shouldMinimize()
- Returns:
- Returns true if the score should be minimized.
-
-
DMelt 3.0 © DataMelt by jWork.ORG