|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--com.softtechdesign.ga.Chromosome
|
+--com.softtechdesign.ga.ChromFloat
Chromosome class where genes are stored as floating point numbers
| Field Summary | |
protected double[] |
genes
array of genes that comprise the chromosome |
| Fields inherited from class com.softtechdesign.ga.Chromosome |
fitness, fitnessRank |
| Constructor Summary | |
ChromFloat(int iGenesDim)
Creates an double array which stores the genes |
|
| Method Summary | |
void |
copyChromGenes(Chromosome chromosome)
Copy the genes from the given chromosome over the existing genes |
double |
getGene(int iGene)
return the gene indexed by iGene as a double |
double[] |
getGenes()
Getter for the genes array |
java.lang.String |
getGenesAsStr()
return the array of genes as a string |
java.lang.String |
getGenesAsString()
Return the array of genes as a string |
int |
getNumGenesInCommon(Chromosome chromosome)
Get the number of genes in common |
void |
setGene(int iGene,
double value)
Set the gene indexed by iGene to the given double value |
java.lang.String |
toString()
Return the genes as a string |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected double[] genes
| Constructor Detail |
public ChromFloat(int iGenesDim)
iGenesDim - | Method Detail |
public double[] getGenes()
public java.lang.String toString()
toString in class java.lang.Objectpublic int getNumGenesInCommon(Chromosome chromosome)
getNumGenesInCommon in class Chromosomechromosome - public java.lang.String getGenesAsString()
public void copyChromGenes(Chromosome chromosome)
copyChromGenes in class ChromosomeChromosome - public double getGene(int iGene)
int - iGene gene to get
public void setGene(int iGene,
double value)
int - gene to setdouble - value to set genepublic java.lang.String getGenesAsStr()
getGenesAsStr in class Chromosome
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||