public class KozaFitness extends Fitness
Default Base
gp.koza.fitness
Modifier and Type | Field and Description |
---|---|
int |
hits
This auxillary measure is used in some problems for additional
information.
|
static java.lang.String |
P_KOZAFITNESS |
protected double |
standardizedFitness
This ranges from 0 (best) to infinity (worst).
|
context, FITNESS_PREAMBLE, P_FITNESS, trials
Constructor and Description |
---|
KozaFitness() |
Modifier and Type | Method and Description |
---|---|
double |
adjustedFitness()
Returns the adjusted fitness metric, which recasts the fitness
to the half-open interval (0,1], where 1 is ideal and 0 is worst.
|
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.
|
Parameter |
defaultBase()
Returns the default base for this prototype.
|
boolean |
equivalentTo(Fitness _fitness)
Should return true if this fitness is in the same equivalence class
as _fitness, that is, neither is clearly better or worse than the
other.
|
double |
fitness()
Returns the adjusted fitness metric, which recasts the
fitness to the half-open interval (0,1], where 1 is ideal and
0 is worst.
|
java.lang.String |
fitnessToString()
Print to a string the fitness in a fashion intended
to be parsed in again via readFitness(...).
|
java.lang.String |
fitnessToStringForHumans()
Print to a string the fitness in a fashion readable by humans, and not intended
to be parsed in again.
|
boolean |
isIdealFitness()
Should return true if this is a good enough fitness to end the run
|
double |
rawFitness()
Deprecated.
use standardizedFitness()
|
void |
readFitness(EvolutionState state,
java.io.DataInput dataInput)
Reads the binary form of an individual from a DataInput.
|
void |
readFitness(EvolutionState state,
java.io.LineNumberReader reader)
Reads in the fitness from a form outputted by fitnessToString() and thus
printFitnessForHumans(...).
|
void |
setFitness(EvolutionState state,
double _f)
Deprecated.
|
void |
setStandardizedFitness(EvolutionState state,
double _f)
Set the standardized fitness in the half-open interval [0.0,infinity)
which is defined (NOTE: DIFFERENT FROM fitness()!!!) as 0.0
being the IDEAL and infinity being worse than the worst possible.
|
void |
setToMeanOf(EvolutionState state,
Fitness[] fitnesses)
Sets the fitness to be the same value as the mean of the provided fitnesses.
|
void |
setup(EvolutionState state,
Parameter base)
Sets up the object by reading it from the parameters stored
in state, built off of the parameter base base.
|
double |
standardizedFitness()
Returns the standardized fitness metric.
|
void |
writeFitness(EvolutionState state,
java.io.DataOutput dataOutput)
Writes the binary form of an individual out to a DataOutput.
|
clone, compareTo, contextIsBetterThan, getContext, merge, printFitness, printFitness, printFitness, printFitnessForHumans, printFitnessForHumans, readTrials, setContext, setContext, setToBestOf, setToMedianOf, writeTrials
public static final java.lang.String P_KOZAFITNESS
protected double standardizedFitness
public int hits
public Parameter defaultBase()
Prototype
public void setFitness(EvolutionState state, double _f)
public void setStandardizedFitness(EvolutionState state, double _f)
public double fitness()
public double rawFitness()
public double standardizedFitness()
public double adjustedFitness()
public void setup(EvolutionState state, Parameter base)
Prototype
For prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.
public boolean isIdealFitness()
Fitness
isIdealFitness
in class Fitness
public boolean equivalentTo(Fitness _fitness)
Fitness
equivalentTo
in class Fitness
public boolean betterThan(Fitness _fitness)
Fitness
betterThan
in class Fitness
public java.lang.String fitnessToString()
Fitness
fitnessToString
in class Fitness
public java.lang.String fitnessToStringForHumans()
Fitness
fitnessToStringForHumans
in class Fitness
public void readFitness(EvolutionState state, java.io.LineNumberReader reader) throws java.io.IOException
Fitness
readFitness
in class Fitness
java.io.IOException
public void writeFitness(EvolutionState state, java.io.DataOutput dataOutput) throws java.io.IOException
Fitness
writeFitness
in class Fitness
java.io.IOException
public void readFitness(EvolutionState state, java.io.DataInput dataInput) throws java.io.IOException
Fitness
readFitness
in class Fitness
java.io.IOException
public void setToMeanOf(EvolutionState state, Fitness[] fitnesses)
Fitness
setToMeanOf
in class Fitness