|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.ai.evolutionary.geneticprogramming.Individual
public class Individual
This class combines a program and its computed fitness values. Raw fitness is the measurement of fitness that is stated in the natural terminology of the problem itself. The most common definition of raw fitness is error: If the S-expression is boolean-valued or symbolic-valued, the sum of distances is equivalent to the number of mismatches. If the S-expression is real-valued or integer-valued, the square root of the sum of the squares of the distances can, alternatively, be used to measure the fitness. (therefore increasing the influence of more distant points) Standardized fitness restates the raw fitness so that a lower numerical value is always a better value. It is convenient and desirable to make the best value of standardized fitness equal 0. If this is not already the case, it can be made so by subtracting (or adding a constant). If for a particular problem, a greater value of raw fitness is better, standardized fitness must be computed from raw fitness. In that situation, standardized fitness equals the maximum possible value of raw fitness(Rmax) minus the observed raw fitness. For ex. If the artifical ant finds 5 0f 89 pieces of food using a given computer program, the raw fitness is 5 and the standardized fitness is 84. Adjusted fitness a(i,t) is computed from the standardized fitness s(i,t) as follows: --- a(i,t) = 1 / 1+s(i,t) --- where s(i,t) is the standardized fitness for individual i at time t. The adjusted fitness lies between 0 and 1. The adjusted fitness is bigger for better individuals in the population. Note that for certain methods of selection other than fitness proportionate selection (e.g. tournament selection and rank selection), adjusted fitness is not relevant and not used. Normalized fitness is also needed if the method of selection employed is fitness proportionate. The normalized fitness n(i,t) is computed from the adjusted fitness a(i,t) as described in Koza's book (ISBN:0262111705) Note that for certain methods of selection other than fitness proportionate selection (e.g. tournament selection and rank selection), normalized fitness is not relevant and not used.
| Constructor Summary | |
|---|---|
Individual(Program program)
Create an individual with given parameters. |
|
| Method Summary | |
|---|---|
Individual |
copy()
Create a deep copy of this individual |
double |
getAdjustedFitness()
Returns adjusted fitness of this individual |
double |
getNormalizedFitness()
Returns normalized fitness of this individual |
Program |
getProgram()
Returns program of this individual |
double |
getStandardizedFitness()
Returns standardized fitness of this individual |
void |
setAdjustedFitness(double newFitness)
Changes adjusted fitness of this individual |
void |
setHits(int newHits)
Changes hits of this individual |
void |
setNormalizedFitness(double newFitness)
Changes normalized fitness of this individual |
void |
setProgram(Program program)
Changes the program of this individual |
void |
setStandardizedFitness(double newFitness)
Changes standardized fitness of this individual |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Individual(Program program)
program - program of this individual| Method Detail |
|---|
public Individual copy()
public Program getProgram()
public void setProgram(Program program)
program - new program of this individualpublic double getNormalizedFitness()
public double getAdjustedFitness()
public double getStandardizedFitness()
public void setNormalizedFitness(double newFitness)
newFitness - new fitness valuepublic void setAdjustedFitness(double newFitness)
newFitness - new fitness valuepublic void setStandardizedFitness(double newFitness)
newFitness - new fitness valuepublic void setHits(int newHits)
newHits - new hits
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||