|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.beans.AbleGeneticObject
Field Summary | |
---|---|
protected java.lang.Object |
chromosome
The population member's chromosome String or array |
protected int |
chromosomeLength
The length of the chromosome String or array |
protected java.lang.Class |
chromosomeType
The type (class) of chromosome |
protected double |
crossoverRate
The crossoverRate -- probability of doing a crossover once a crossover operator is selected |
protected AbleAgent |
evaluationAgent
The single evaluationAgent used to compute fitness (optional) |
protected double |
fitness
The current raw fitness value |
protected boolean |
fitnessComputed
A boolean flag that is true if the fitness has already been computed. |
protected AbleBean |
member
The associated AbleBean used to compute fitness (optional) |
protected double |
mutationRate
The mutationRate -- probability of mutating a bit once a mutation operator is selected |
protected double |
normalizedFitness
The normalized fitness value (set by the search agent) |
protected AbleAgent |
searchAgent
The parent genetic search agent |
protected static long |
serialVersionUID
|
protected java.lang.String |
vocabulary
The vocabulary used by String chromosomes |
Constructor Summary | |
---|---|
AbleGeneticObject()
construct a genetic object |
Method Summary | |
---|---|
double |
binaryToInteger(java.lang.String binCode)
Convert a binary code into an integer This method is provided as a utility function |
double |
computeFitness()
compute the fitness value for this population member Note: this could be an expensive operation |
static java.lang.String |
Copyright()
Determine the copyright of this class. |
java.lang.Object |
generateRandomChromosome(int chromosomeLen)
generate a random chromosome for this object based on the specified chromosomeLength, and vocabulary |
AbleBean |
getBean()
return the underlying AbleBean (if any) |
java.lang.Object |
getChromosome()
return the chromosome for this object Note: value is usually a String, but could be other array types |
int |
getChromosomeLength()
return the length of the chromosome used by these genetic objects |
java.lang.Class |
getChromosomeType()
return the chromosome type for this object Note: value is usually a String, but could be other array types |
double |
getCrossoverRate()
return the crossover rate |
double |
getFitness()
return the fitness value for this member Note: use computeFitness() to do the computation |
double |
getMutationRate()
return the mutation rate |
double |
getNormalizedFitness()
|
java.util.Hashtable |
getOperatorFitness()
Return a hashtable of operator names (keys) and fitness values (Doubles). |
java.lang.Object |
getRandomChromosome()
generate a random chromosome for this genetic object use this to initialize the underlying AbleBean (if any) |
java.lang.String |
getVocabulary()
return the vocabulary used for the chromosomes Note: this is usually the alphabet "01" or "abc", but could be a more descriptive string "real" or "hybrid" if a non-String chromosome format is used. |
void |
initBean()
create and initialize the underlying AbleBean add it to the evaluationAgent |
AbleAgent |
initEvaluationAgent()
return the special EvaluationAgent (if any) Note: this should only get called once by the search agent |
java.lang.Object[] |
mutate(java.lang.Object[] parents)
Given 2 population members Mutate their chromosomes (subject to mutation rate) |
java.lang.String |
mutateChromosome(java.lang.String chromosome)
Mutate a single chromosome Note: this operator does a bitwise test against the mutationRate and then rolls the dice to select a new bit value from the vocabulary |
java.lang.Object[] |
onePointCrossover(java.lang.Object[] parents)
Given 2 population members (parents) Do a single point crossover (subject to crossover rate), creating 2 children |
java.lang.Object[] |
onePointCrossoverAndMutate(java.lang.Object[] parents)
Given 2 parent chromosomes Do a single point crossover (or not), creating 2 children chromosomes And mutate bits at the specified rate |
void |
registerOperators(AbleAgent agent)
register any unique or overridden operators (user-defined functions) with the SearchAgent |
void |
removeBean()
remove the underlying AbleBean (if any) |
void |
setChromosome(java.lang.Object s)
set the chromosome for this genetic object create and initialize any underlying AbleBean and immediately compute the member's fitness |
void |
setCrossoverRate(double rate)
set the crossover rate for use by any crossover operators |
void |
setEvaluationAgent(AbleAgent evalAgent)
set the special EvaluationAgent |
void |
setMutationRate(double rate)
set the mutation rate for use by any mutation operators |
void |
setNormalizedFitness(double value)
|
java.lang.String |
toString()
Return a string formatted for display. |
java.lang.Object[] |
twoPointCrossover(java.lang.Object[] parents)
Given 2 population members (parents) Do a two point crossover (subject to crossover rate), creating 2 children |
java.lang.Object[] |
uniformCrossover(java.lang.Object[] parents)
Given 2 population members (parents) Do a uniform crossover (subject to crossover rate) , creating 2 children |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final long serialVersionUID
protected AbleAgent searchAgent
protected AbleAgent evaluationAgent
protected java.lang.Object chromosome
protected AbleBean member
protected java.lang.String vocabulary
protected java.lang.Class chromosomeType
protected int chromosomeLength
protected double fitness
protected boolean fitnessComputed
protected double normalizedFitness
protected double crossoverRate
protected double mutationRate
Constructor Detail |
public AbleGeneticObject()
Method Detail |
public AbleBean getBean()
public void removeBean() throws AbleException
public AbleAgent initEvaluationAgent()
public void setEvaluationAgent(AbleAgent evalAgent)
public double getFitness()
public void setNormalizedFitness(double value)
public double getNormalizedFitness()
public double computeFitness()
public java.lang.Object getRandomChromosome()
public void setChromosome(java.lang.Object s)
public void initBean()
public java.lang.Object getChromosome()
public int getChromosomeLength()
public java.lang.String getVocabulary()
public java.lang.Class getChromosomeType()
public void setCrossoverRate(double rate)
public double getCrossoverRate()
public void setMutationRate(double rate)
public double getMutationRate()
public java.lang.Object generateRandomChromosome(int chromosomeLen)
public java.lang.Object[] onePointCrossoverAndMutate(java.lang.Object[] parents)
public java.lang.String mutateChromosome(java.lang.String chromosome)
the
- original chromosome stringpublic java.lang.Object[] onePointCrossover(java.lang.Object[] parents)
parents
- the parent chromosomespublic java.lang.Object[] twoPointCrossover(java.lang.Object[] parents)
parents
- the parent chromosomespublic java.lang.Object[] uniformCrossover(java.lang.Object[] parents)
parents
- the parent chromosomespublic java.lang.Object[] mutate(java.lang.Object[] parents)
the
- parent chromosomespublic void registerOperators(AbleAgent agent)
the
- search agentpublic java.util.Hashtable getOperatorFitness() throws AbleException
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]public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String Copyright()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |