|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdt.ga.Organism
This is the base class which represents an individual in a GA. This is the class every Organism has to extend in order to implement its own GA. The Fitness class has to be extended also along with this.
Field Summary | |
protected Fitness |
fitness
Fitness class associated with this organism. |
protected GeneticAlgorithm |
ga
Genetic Algorithm class associated with this organism. |
int |
id
Organism id |
static java.lang.Object |
initOrganism
Instance of the organism created at startup. |
Constructor Summary | |
Organism()
|
Method Summary | |
java.lang.Object |
clone()
Implementation of the clone method. |
abstract void |
crossover(Organism org)
Specify the implementation of a crossover. |
abstract Fitness |
evaluate()
Specify how the fitness is evaluated. |
protected void |
finalize()
For garbage collection |
Fitness |
getFitness()
Returns the fitness of the organism. |
abstract java.lang.Object |
getInitialOrganism()
get the initial organism to serve as a template |
abstract double |
getPhenotypeComp(Organism lc)
?? |
boolean |
hasFitness()
Returns if the fitness is evaluated. |
abstract void |
mutate()
Specify the implementation of mutation. |
static Organism |
newInstance(GeneticAlgorithm ga)
This is the preferred way to instantiate an organism, since it appropriately sets the ga field. |
abstract void |
randomize()
Specify the randomize method. |
abstract java.lang.Object |
readSerializable(java.io.ObjectInputStream in)
Specify the communication protocol to create the organism from the output stream. |
protected void |
setFitness(Fitness fitness)
This methods assigns the calculated fitness to the organism. |
protected void |
setGA(GeneticAlgorithm ga)
set the ga variable of this class |
abstract void |
writeSerializable(java.io.ObjectOutputStream out)
Specify the communication protocol to write the organism to the output stream. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected transient GeneticAlgorithm ga
protected Fitness fitness
public static java.lang.Object initOrganism
public int id
Constructor Detail |
public Organism()
Method Detail |
public static Organism newInstance(GeneticAlgorithm ga)
public abstract java.lang.Object getInitialOrganism()
protected void setGA(GeneticAlgorithm ga)
public abstract java.lang.Object readSerializable(java.io.ObjectInputStream in)
public abstract void writeSerializable(java.io.ObjectOutputStream out)
public java.lang.Object clone()
public abstract void randomize()
public abstract void crossover(Organism org)
public abstract void mutate()
public abstract Fitness evaluate()
protected final void setFitness(Fitness fitness)
public boolean hasFitness()
public final Fitness getFitness()
public abstract double getPhenotypeComp(Organism lc)
protected void finalize() throws java.lang.Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |