|
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 | +--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 |
static java.lang.String |
Copyright()
Determine the copyright of this class. |
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 Note: this operator does a bitwise test against the mutationRate and then rolls the dice to select a delta to the current value |
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 AbleGeneticObject
public java.lang.Object getRandomChromosome()
getRandomChromosome
in class AbleGeneticObject
public double computeFitness()
computeFitness
in class AbleGeneticObject
com.ibm.able.beans.AbleGeneticObject
protected double f6(double x, double y)
public double[] mutateChromosome(double[] chromosome)
the
- original chromosome arraypublic java.lang.Object[] onePointCrossoverAndMutate(java.lang.Object[] parents)
onePointCrossoverAndMutate
in class AbleGeneticObject
public java.lang.Object[] average(java.lang.Object[] parents)
public java.util.Hashtable getOperatorFitness() throws AbleException
getOperatorFitness
in class AbleGeneticObject
public void registerOperators(AbleAgent agent)
registerOperators
in class AbleGeneticObject
the
- search agentpublic java.lang.String toString()
toString
in class AbleGeneticObject
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 |