|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mss.ea.eval.DefaultFitness
Base class for fitness values. The fitness of an individual is represented by a float number. A bigger float number is a better fitness. The smallest possible fitness should be 0.0 (but need not).
Field Summary | |
protected float |
fitness
Float field, holding the current fitness value. |
Fields inherited from interface mss.ea.core.Fitness |
serialVersionUID |
Constructor Summary | |
DefaultFitness()
Constructor. |
|
DefaultFitness(float value)
Constructor with float value. |
|
DefaultFitness(java.lang.Float value)
Constructor with Float object. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Comparison of two fitness values. |
float |
getValue()
Deprecated. replaced by value() |
boolean |
isBetter(Fitness fn)
Test, if fitness is better than other fitness. |
boolean |
isEqual(Fitness fn)
Test, if fitness equals with other fitness. |
boolean |
isWorse(Fitness fn)
Test, if fitness is worse than other fitness. |
void |
setValue(float value)
Sets the fitness value. |
java.lang.String |
toString()
String representation of fitness value. |
float |
value()
Gets the fitness value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected float fitness
Constructor Detail |
public DefaultFitness()
public DefaultFitness(float value)
value
- fitness valuepublic DefaultFitness(java.lang.Float value)
value
- fitness valueMethod Detail |
public void setValue(float value)
setValue
in interface Fitness
value
- new fitness valuepublic float getValue()
getValue
in interface Fitness
public float value()
value
in interface Fitness
public boolean isBetter(Fitness fn)
isBetter
in interface Fitness
fn
- fitness, to be compared withpublic boolean isWorse(Fitness fn)
isWorse
in interface Fitness
fn
- other fitness, to be compared withpublic boolean isEqual(Fitness fn)
isEqual
in interface Fitness
fn
- other fitness, to be compared withpublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- other fitness, to be compared withpublic java.lang.String toString()
toString
in class java.lang.Object
|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |