org.encog.ml.ea.sort
Interface GenomeComparator

All Superinterfaces:
Comparator<Genome>
All Known Implementing Classes:
AbstractGenomeComparator, MaximizeAdjustedScoreComp, MaximizeScoreComp, MinimizeAdjustedScoreComp, MinimizeScoreComp

public interface GenomeComparator
extends Comparator<Genome>

Defines methods for comparing genomes. Also provides methods to apply bonuses and penalties.


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.
 boolean isBetterThan(double d1, double d2)
          Determine if one score is better than the other.
 boolean isBetterThan(Genome genome1, Genome genome2)
          Determine if one genome is better than the other genome.
 boolean shouldMinimize()
           
 
Methods inherited from interface java.util.Comparator
compare, equals
 

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.


Copyright © 2014. All Rights Reserved.