|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--gpsys.Fitness
|
+--gpsys.symreg.SymRegFitness
The Fitness class for the symbolic regression problem. The fitness is measured using two values. The first is the error between the real function and the function generated by the GP system. The second value is the complexity of the GP program. The fitness of one GP is is deemed better than another if either the error is smaller or if the error is equal, but the complexity is smaller. The termination criteria is met when the error is zero. This problem involves finding the function :-
x^3 + 2x^2 +3x + 5
| Field Summary | |
(package private) int |
complexity
The complexity of the GP i.e. |
(package private) double |
fitness
The error between the ideal function and the GP. |
static float |
from
The minimum value of x to be used for testing the evolved function. |
static int |
samples
The number of samples used test the evolved function. |
static float |
to
The maximum value of x to be used for testing the evolved function. |
| Constructor Summary | |
SymRegFitness()
Construct a Fitness object with default Fitness. |
|
SymRegFitness(GPParameters gpParameters,
Individual i)
Constructs a Fitness object by evaluating an Individual. |
|
| Method Summary | |
void |
add(Fitness f)
Adds a fitness value to this fitness value. |
void |
divide(int divisor)
Divide the fitness by the specified integer. |
boolean |
equals(Fitness f)
Tests if this fitness is equal to another fitness. |
boolean |
greaterThan(Fitness f)
Tests if this fitness value is greater than another fitness value. |
Fitness |
instance()
Creates a new instance of the Fitness object with a default fitness. |
Fitness |
instance(GPParameters gpParameters,
Individual i)
Creates a new instance of the Fitness object which represents the fitness of the specified individual. |
boolean |
lessThan(Fitness f)
Tests if this fitness is less than another fitness. |
boolean |
terminationCondition()
Tests whether this fitness meets the termination criteria. |
java.lang.String |
toString()
Converts the fitness into a String suitable for printing. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
double fitness
int complexity
public static float from
public static float to
public static int samples
| Constructor Detail |
public SymRegFitness()
public SymRegFitness(GPParameters gpParameters,
Individual i)
gpParameters - The GP parameters for this run.i - The individual to be evaluated.| Method Detail |
public void add(Fitness f)
f - the fitness value to be added.public void divide(int divisor)
divisor - the integer to divide the fitness by.public boolean greaterThan(Fitness f)
f - the fitness with which to compare.public boolean lessThan(Fitness f)
f - the fitness with which to compare.public boolean equals(Fitness f)
f - the fitness with which to compare.public Fitness instance()
public Fitness instance(GPParameters gpParameters,
Individual i)
gpParameters - the parameters for this GP run.i - the individual to be evaluated.public boolean terminationCondition()
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||