|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IChromosome
Defines methods required by chromosomes for a genetic algorithm.
Field Summary | |
---|---|
static int |
UNKNOWN_FITNESS
Constant which indicates that the fitness is unknown. |
Method Summary | |
---|---|
void |
addFitness(int value)
Add to the fitness. |
Object |
clone()
Return a clone of this instance. |
void |
copy(IChromosome another)
Copy the given chromosome into this. |
boolean |
equals(Object another)
Return true if this equals the given object. |
String |
getDescription()
Return the description. |
int |
getFitness()
Return the fitness. |
boolean |
isFitnessUnknown()
Return true if the fitness is unknown. |
void |
mix(IChromosome c1,
IChromosome c2,
boolean[] mask)
Mix the genes of the given chromosomes into this using the given mask. |
void |
mix(IChromosome c1,
IChromosome c2,
double fraction)
Mix the genes of the given chromosomes into this using the given fraction. |
void |
mutate(double mutationRate,
double mutationMagnitude)
Mutate this chromosome's genes using the given parameters. |
void |
randomlyInitialize()
Initialize the genes with random values. |
void |
setDescription(String description)
Set the description. |
void |
setFitness(int fitness)
Set the fitness. |
void |
setFitnessUnknown()
Set the fitness to unknown. |
int |
size()
Return the number of genes. |
void |
splice(IChromosome c1,
IChromosome c2,
int cut)
Splice the given chromosomes into this using the given cut index. |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
static final int UNKNOWN_FITNESS
Method Detail |
---|
void addFitness(int value)
Object clone()
void copy(IChromosome another)
boolean equals(Object another)
equals
in class Object
String getDescription()
int getFitness()
boolean isFitnessUnknown()
void mix(IChromosome c1, IChromosome c2, boolean[] mask)
void mix(IChromosome c1, IChromosome c2, double fraction)
void mutate(double mutationRate, double mutationMagnitude)
mutationRate
- Probability of a gene being mutated.mutationMagnitude
- The maximum allowed magnitude of the mutation.void randomlyInitialize()
void setDescription(String description)
void setFitness(int fitness)
void setFitnessUnknown()
int size()
void splice(IChromosome c1, IChromosome c2, int cut)
|
||||||||||
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 |