|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--search.GeneticSearchObject
The GeneticSearchObject
class is used to represent a
member of the population being searched or optimized using a
genetic search algorithm.
Field Summary | |
protected java.lang.String |
chromosome
|
protected int |
chromosomeLength
|
protected double |
crossoverRate
|
protected double |
fitness
|
protected boolean |
fitnessComputed
|
protected double |
mutationRate
|
protected GeneticSearch |
searchAgent
|
protected java.lang.String |
vocabulary
|
Constructor Summary | |
GeneticSearchObject()
Creates a GeneticSearchObject . |
Method Summary | |
double |
binaryToInteger(java.lang.String binCode)
Converts a binary code into a double integer. |
double |
computeFitness()
Returns the fitness value for this population member. |
java.lang.String |
generateRandomChromosome()
Generates a random chromosome for this population member, based on the chromosome length and vocabulary. |
java.lang.String |
getChromosome()
Retrieves the chromosome for this population member. |
int |
getChromosomeLength()
Retrieves the length of the chromosome. |
double |
getCrossoverRate()
Retrieves the crossover rate used by any crossover operators. |
double |
getFitness()
Retrieves the fitness value for this population member. |
double |
getMutationRate()
Retrieves the mutation rate used by any mutation operators. |
java.util.Hashtable |
getOperatorFitness()
Retrieves a table of operator names and fitness values. |
java.lang.String |
getRandomChromosome()
Retrieves a random chromosome for this population member. |
java.lang.String |
getVocabulary()
Retrieve the vocabulary used for the chromosomes, which is usually the alphabet "01" or "abc". |
void |
setChromosome(java.lang.String chromosome)
Sets the chromosome for this population member and computes the member's fitness. |
void |
setCrossoverRate(double rate)
Sets the crossover rate for use by any crossover operators. |
void |
setMutationRate(double rate)
Sets the mutation rate for use by any mutation operators. |
java.lang.String |
toString()
Generates a string from the chromosome and fitness values. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected GeneticSearch searchAgent
protected java.lang.String chromosome
protected java.lang.String vocabulary
protected int chromosomeLength
protected double fitness
protected boolean fitnessComputed
protected double crossoverRate
protected double mutationRate
Constructor Detail |
public GeneticSearchObject()
GeneticSearchObject
.Method Detail |
public double getFitness()
public double computeFitness()
public java.lang.String getRandomChromosome()
public void setChromosome(java.lang.String chromosome)
chromosome
- the String that represents the chromosomepublic java.lang.String getChromosome()
public int getChromosomeLength()
public java.lang.String getVocabulary()
public void setCrossoverRate(double rate)
rate
- the double value of the crossover ratepublic double getCrossoverRate()
public void setMutationRate(double rate)
rate
- the double value of the crossover ratepublic double getMutationRate()
public java.lang.String generateRandomChromosome()
public java.util.Hashtable getOperatorFitness()
public java.lang.String toString()
public double binaryToInteger(java.lang.String binCode)
binCode
- a String of 1s and 0s with MSB being char[0]
and LSB being char[n-1]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |