|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.ai.geneticalgorithm.AbstractChromosome
public abstract class AbstractChromosome
Provides base functionality for chromosomes for a genetic algorithm.
Field Summary |
---|
Fields inherited from interface org.vizzini.ai.geneticalgorithm.IChromosome |
---|
UNKNOWN_FITNESS |
Constructor Summary | |
---|---|
AbstractChromosome()
|
Method Summary | |
---|---|
void |
addFitness(int value)
Add to the fitness. |
Object |
clone()
Return a clone of this instance. |
int |
compareTo(Object another)
Return -1, 0, or 1 if this is less than, equal to, or greater than the given chromosome. |
void |
copy(IChromosome another)
Copy the given chromosome into this. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
String |
getDescription()
Return the description. |
int |
getFitness()
Return the fitness. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isFitnessUnknown()
Return true if the fitness is unknown. |
void |
mix(IChromosome c1,
IChromosome c2,
double fraction)
Mix the genes of the given chromosomes into this using the given fraction. |
void |
setDescription(String description)
Set the description. |
void |
setFitness(int fitness)
Set the fitness. |
void |
setFitnessUnknown()
Set the fitness to unknown. |
String |
toString()
Return a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.vizzini.ai.geneticalgorithm.IChromosome |
---|
mix, mutate, randomlyInitialize, size, splice |
Constructor Detail |
---|
public AbstractChromosome()
Method Detail |
---|
public void addFitness(int value)
addFitness
in interface IChromosome
public Object clone()
clone
in interface IChromosome
clone
in class Object
public int compareTo(Object another)
compareTo
in interface Comparable
public void copy(IChromosome another)
copy
in interface IChromosome
public boolean equals(Object object)
equals
in interface IChromosome
equals
in class Object
object
- The object to compare.public String getDescription()
getDescription
in interface IChromosome
public int getFitness()
getFitness
in interface IChromosome
public int hashCode()
hashCode
in class Object
public boolean isFitnessUnknown()
isFitnessUnknown
in interface IChromosome
public void mix(IChromosome c1, IChromosome c2, double fraction)
mix
in interface IChromosome
public void setDescription(String description)
setDescription
in interface IChromosome
public void setFitness(int fitness)
setFitness
in interface IChromosome
public void setFitnessUnknown()
setFitnessUnknown
in interface IChromosome
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |