|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.bio.EvolveStandard
EvolveStandard implements the Evolvable interface and
provides default behaviour for fitness values, as well as providing the necessary
Comparable implementation for sorting in both ascending and descending
order.
| Field Summary | |
protected double |
fitnessValue
The fitness value. |
protected boolean |
minimizeFitness
Whether the genetic algorithm minimize or maximize the fitness. |
protected static java.util.Random |
random
An instance of java.util.Random, useful for generating a range of random numbers. |
| Constructor Summary | |
EvolveStandard()
Creates a new instance of EvolveStandard |
|
| Method Summary | |
abstract void |
calculateFitness()
The fitness function. |
int |
compareTo(java.lang.Object o)
Compares two EvolveStandard objects and sorts by fitness. |
double |
getFitness()
Retrieve the fitness of this instance. |
abstract Evolvable |
mate(Evolvable partner)
Abstract function to mate with another object to produce an offspring for the next generation. |
abstract void |
mutate()
Abstract function to mutate the object. |
abstract void |
randomInitialize()
An abstract function to randomize the object's initial settings. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected double fitnessValue
protected boolean minimizeFitness
compareTo(Object)protected static java.util.Random random
| Constructor Detail |
public EvolveStandard()
| Method Detail |
public abstract void calculateFitness()
calculateFitness in interface Evolvablepublic int compareTo(java.lang.Object o)
EvolveStandard objects and sorts by fitness. By default,
values are sorted in ascending order.
compareTo in interface java.lang.Comparableo - the object to compare to.
public double getFitness()
getFitness in interface Evolvablepublic abstract Evolvable mate(Evolvable partner)
mate in interface Evolvablepartner - the partner object.
public abstract void mutate()
mutate in interface Evolvablepublic abstract void randomInitialize()
randomInitialize in interface Evolvable
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||