|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.beans.AbleGeneticObject
com.ibm.able.examples.genetic.TstGeneticFunction2a
This class implements the F6 function described in the first chapter of The Handbook of Genetic Algorithms (Davis) Is used a hybrid (numeric) chromosome representation
| Field Summary | |
|---|---|
static double |
factor
|
protected static long |
serialVersionUID
Serialized version identifier in form YYYYMMDDVerRelModxx |
| Fields inherited from class com.ibm.able.beans.AbleGeneticObject |
|---|
chromosome, chromosomeLength, chromosomeType, crossoverRate, evaluationAgent, fitness, fitnessComputed, member, mutationRate, normalizedFitness, searchAgent, vocabulary |
| Constructor Summary | |
|---|---|
TstGeneticFunction2a()
|
|
| Method Summary | |
|---|---|
java.lang.Object[] |
average(java.lang.Object[] parents)
Given 2 parent chromosomes Average their values , creating 2 children chromosomes |
double |
computeFitness()
just add up the number of ones in the chromosome |
protected double |
f6(double x,
double y)
|
double |
getFitness()
return the fitness value for this member Note: use computeFitness() to do the computation |
java.util.Hashtable |
getOperatorFitness()
Return a hashtable of operator names (keys) and fitness values (Doubles) fitness values must sum to 100 Note: this hashtable may be extended to using operator fitness objects vs fixed values so that we can adapt the operators selection during the search process |
java.lang.Object |
getRandomChromosome()
generate a random chromosome for this genetic object |
double[] |
mutateChromosome(double[] chromosome)
Mutate a single chromosome. |
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. |
java.lang.String |
toString()
return a string formatted for display default is the chromosome string and fitness if chromosome is not a string, then just fitness is returned Subclasses should override if necessary |
| Methods inherited from class com.ibm.able.beans.AbleGeneticObject |
|---|
binaryToInteger, generateRandomChromosome, getBean, getChromosome, getChromosomeLength, getChromosomeType, getCrossoverRate, getMutationRate, getNormalizedFitness, getVocabulary, initBean, initEvaluationAgent, mutate, mutateChromosome, onePointCrossover, removeBean, setChromosome, setCrossoverRate, setEvaluationAgent, setMutationRate, setNormalizedFitness, twoPointCrossover, uniformCrossover |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final long serialVersionUID
public static final double factor
| Constructor Detail |
public TstGeneticFunction2a()
| Method Detail |
public double getFitness()
AbleGeneticObject
getFitness in class AbleGeneticObjectpublic java.lang.Object getRandomChromosome()
getRandomChromosome in class AbleGeneticObjectpublic double computeFitness()
computeFitness in class AbleGeneticObject
protected double f6(double x,
double y)
public double[] mutateChromosome(double[] chromosome)
chromosome - The original chromosome array.
public java.lang.Object[] onePointCrossoverAndMutate(java.lang.Object[] parents)
onePointCrossoverAndMutate in class AbleGeneticObjectpublic java.lang.Object[] average(java.lang.Object[] parents)
public java.util.Hashtable getOperatorFitness()
throws AbleException
getOperatorFitness in class AbleGeneticObjectAbleExceptionpublic void registerOperators(AbleAgent agent)
registerOperators in class AbleGeneticObjectagent - The search agent.public java.lang.String toString()
toString in class AbleGeneticObject
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||