|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Fitness is a prototype which describes the fitness of an individual. Every individual contains exactly one Fitness object. Fitness objects are compared to each other with the equivalentTo() and betterThan(), etc. methods.
Rules:
comparison | method |
a > b | a.betterThan(b) |
a >= b | a.betterThan(b) || a.equivalentTo(b) |
a = b | a.equivalentTo(b) |
Parameter bases
fit | default fitness base |
Field Summary | |
static java.lang.String |
P_FITNESS
|
Method Summary | |
boolean |
betterThan(Fitness _fitness)
Should return true if this fitness is clearly better than _fitness; You may assume that _fitness is of the same class as yourself. |
boolean |
equivalentTo(Fitness _fitness)
Should return true if this fitness is in the same equivalence class as _fitness, that is, neither is clearly bettter or worse than the other. |
float |
fitness()
Should return an absolute fitness value in the half-open range [0.0,infinity), where 0.0 is <= the worst possible value, and inifity is > the ideal fitness. |
boolean |
isIdealFitness()
Should return true if this is a good enough fitness to end the run |
void |
printFitness(EvolutionState state,
int log,
int verbosity)
Should print the fitness out in a computer-readable fashion, using state.output.println(...,verbosity,log). |
void |
printFitness(EvolutionState state,
java.io.PrintWriter writer)
Should print the fitness out in a computer-readable fashion, using state.output.println(...,verbosity,log). |
void |
printFitnessForHumans(EvolutionState state,
int log,
int verbosity)
Should print the fitness out in a pleasing way to humans, using state.output.println(...,verbosity,log) |
void |
readFitness(EvolutionState state,
java.io.LineNumberReader reader)
Reads in the fitness from a form printed by printFitness(). |
Methods inherited from interface ec.Prototype |
defaultBase, protoClone, protoCloneSimple, setup |
Field Detail |
public static final java.lang.String P_FITNESS
Method Detail |
public float fitness()
This function should be used only by fitness-proportionate selection and other selection methods which require an absolute fitness value. All other approaches should use the equivalentTo() and betterThan() methods.
If your fitness scheme does not use a metric quantifiable to a single value (for example, MultiObjectiveFitness), you should perform some reasonable translation.
public boolean isIdealFitness()
public boolean equivalentTo(Fitness _fitness)
public boolean betterThan(Fitness _fitness)
public void printFitnessForHumans(EvolutionState state, int log, int verbosity)
public void printFitness(EvolutionState state, int log, int verbosity)
public void printFitness(EvolutionState state, java.io.PrintWriter writer)
public void readFitness(EvolutionState state, java.io.LineNumberReader reader) throws java.io.IOException, java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |