|
||||||||||
| 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 IChromosomepublic Object clone()
clone in interface IChromosomeclone in class Objectpublic int compareTo(Object another)
compareTo in interface Comparablepublic void copy(IChromosome another)
copy in interface IChromosomepublic boolean equals(Object object)
equals in interface IChromosomeequals in class Objectobject - The object to compare.public String getDescription()
getDescription in interface IChromosomepublic int getFitness()
getFitness in interface IChromosomepublic int hashCode()
hashCode in class Objectpublic boolean isFitnessUnknown()
isFitnessUnknown in interface IChromosome
public void mix(IChromosome c1,
IChromosome c2,
double fraction)
mix in interface IChromosomepublic void setDescription(String description)
setDescription in interface IChromosomepublic void setFitness(int fitness)
setFitness in interface IChromosomepublic void setFitnessUnknown()
setFitnessUnknown in interface IChromosomepublic 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 |