|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IChromosome
Interface for chromosomes.
| Field Summary | |
|---|---|
static java.lang.String |
CVS_REVISION
String containing the CVS revision. |
static java.lang.String |
S_ALLELES
|
static java.lang.String |
S_APPLICATION_DATA
|
static java.lang.String |
S_FITNESS_VALUE
Constants for toString() |
static java.lang.String |
S_SIZE
|
| Method Summary | |
|---|---|
void |
cleanup()
Invoked when this Chromosome is no longer needed and should perform any necessary cleanup. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
java.lang.Object |
getApplicationData()
Retrieves the application-specific data that is attached to this Chromosome. |
Configuration |
getConfiguration()
|
double |
getFitnessValue()
Retrieves the fitness value of this Chromosome, as determined by the active fitness function. |
double |
getFitnessValueDirectly()
|
Gene |
getGene(int a_desiredLocus)
Returns the Gene at the given index (locus) within the Chromosome. |
Gene[] |
getGenes()
Retrieves the set of genes that make up this Chromosome. |
boolean |
isSelectedForNextGeneration()
Retrieves whether this Chromosome has been selected by the natural selector to continue to the next generation. |
void |
setApplicationData(java.lang.Object a_newData)
This sets the application-specific data that is attached to this Chromosome. |
void |
setConstraintChecker(IGeneConstraintChecker a_constraintChecker)
Sets the constraint checker to be used for this gene whenever method setAllele(Object) is called. |
void |
setFitnessValue(double a_newFitnessValue)
Sets the fitness value of this Chromosome. |
void |
setFitnessValueDirectly(double a_newFitnessValue)
Sets the fitness value of this Chromosome directly without any constraint checks, conversions or checks. |
void |
setGenes(Gene[] a_genes)
Sets the genes for the chromosome. |
void |
setIsSelectedForNextGeneration(boolean a_isSelected)
Sets whether this Chromosome has been selected by the natural selector to continue to the next generation or manually (e.g. via an add-method). |
int |
size()
Returns the size of this Chromosome (the number of genes it contains). |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
static final java.lang.String CVS_REVISION
static final java.lang.String S_FITNESS_VALUE
static final java.lang.String S_ALLELES
static final java.lang.String S_APPLICATION_DATA
static final java.lang.String S_SIZE
| Method Detail |
|---|
Gene getGene(int a_desiredLocus)
a_desiredLocus - index of the gene value to be returned
Gene[] getGenes()
void setGenes(Gene[] a_genes)
throws InvalidConfigurationException
a_genes - the genes to set for the chromosome
InvalidConfigurationException - in case constraint checker is
providedint size()
void setFitnessValue(double a_newFitnessValue)
a_newFitnessValue - a positive integer representing the fitness
of this Chromosomevoid setFitnessValueDirectly(double a_newFitnessValue)
a_newFitnessValue - a positive integer representing the fitness
of this Chromosomedouble getFitnessValue()
Attention: should not be called from toString() as the fitness value would be computed if it was initial!
double getFitnessValueDirectly()
void setIsSelectedForNextGeneration(boolean a_isSelected)
a_isSelected - true if this Chromosome has been selected, false
otherwiseboolean isSelectedForNextGeneration()
java.lang.Object clone()
java.lang.IllegalStateException - instead of CloneNotSupportedException
void setConstraintChecker(IGeneConstraintChecker a_constraintChecker)
throws InvalidConfigurationException
a_constraintChecker - the constraint checker to be set
InvalidConfigurationExceptionvoid setApplicationData(java.lang.Object a_newData)
a_newData - the new application-specific data to attach to this
Chromosome. Should be an instance of IApplicationDatajava.lang.Object getApplicationData()
void cleanup()
Configuration getConfiguration()
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||