|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.ml.genetic.genome.GenomeComparator
public class GenomeComparator
Used to compare two genomes, a score object is used.
| Constructor Summary | |
|---|---|
GenomeComparator(CalculateGenomeScore theCalculateScore)
Construct the genome comparator. |
|
| Method Summary | |
|---|---|
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. |
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. |
double |
bestScore(double d1,
double d2)
Determine the best score from two scores, uses the "should minimize" property of the score function. |
int |
compare(Genome genome1,
Genome genome2)
Compare two genomes. |
CalculateGenomeScore |
getCalculateScore()
|
boolean |
isBetterThan(double d1,
double d2)
Determine if one score is better than the other. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public GenomeComparator(CalculateGenomeScore theCalculateScore)
theCalculateScore - The score calculation object to use.| Method Detail |
|---|
public final double applyBonus(double value,
double bonus)
value - The current value.bonus - The bonus.
public final double applyPenalty(double value,
double bonus)
value - The current value.bonus - The penalty.
public final double bestScore(double d1,
double d2)
d1 - The first score.d2 - The second score.
public final int compare(Genome genome1,
Genome genome2)
compare in interface Comparator<Genome>genome1 - The first genome.genome2 - The second genome.
public final CalculateGenomeScore getCalculateScore()
public final boolean isBetterThan(double d1,
double d2)
d1 - The first score to compare.d2 - The second score to compare.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||