bodhidharma.classifiers.genetic_algorithms
Class Evaluator
java.lang.Object
bodhidharma.classifiers.genetic_algorithms.Evaluator
- Direct Known Subclasses:
- ClassifierSelectionEvaluator, ClassifierWeightingEvaluator, FeatureSelectionEvaluator, FeatureWeightingEvaluator
public abstract class Evaluator
- extends java.lang.Object
Objects of this class evaluate and interpret the meaning of bit strings stored in
genetic algorithm Chromosome
objects. Although Chromosome
and Breeder
objects are general purpose, Evaluator
objects
have a specialized purpose.
All classes implementing this interface should include a constructor that sets
the number of bits in a bit string.
- See Also:
Chromosome
,
Breeder
Method Summary |
int |
getBitStringLength()
Returns the number of bits held in the bit string of any Chromosome that
could be fed to this Evaluator object. |
abstract double |
getFitness(short[] bit_string)
Return the fitness of a chromosome given its DNA (bit string). |
abstract java.lang.Object[] |
parseBitString(short[] bit_string)
Returns an array of Objects holding the meaning of the given bit string
of a Chromosome . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bit_string_length
protected int bit_string_length
Evaluator
public Evaluator()
getFitness
public abstract double getFitness(short[] bit_string)
throws java.lang.Exception
- Return the fitness of a chromosome given its DNA (bit string). The fitness
should vary between 0 (least fit possible) and 1 (most fit possible). This
need not be normalized. Bit strings passed to this method must be
of the same length as the length specified in the constructor of this
object.
- Throws:
java.lang.Exception
parseBitString
public abstract java.lang.Object[] parseBitString(short[] bit_string)
throws java.lang.Exception
- Returns an array of Objects holding the meaning of the given bit string
of a
Chromosome
. Bit strings passed to this method must be
of the same length as the length specified in the constructor of this
object.
- Throws:
java.lang.Exception
getBitStringLength
public int getBitStringLength()
- Returns the number of bits held in the bit string of any
Chromosome
that
could be fed to this Evaluator
object.