|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.ai.geneticalgorithm.AbstractChromosome
org.vizzini.ai.geneticprogramming.AbstractChromosomeGP
public abstract class AbstractChromosomeGP
Provides base functionality for a chromosome in genetic programming.
| Field Summary |
|---|
| Fields inherited from interface org.vizzini.ai.geneticalgorithm.IChromosome |
|---|
UNKNOWN_FITNESS |
| Constructor Summary | |
|---|---|
AbstractChromosomeGP()
Construct this object. |
|
AbstractChromosomeGP(IFunction function)
Construct this object with the given parameter. |
|
| Method Summary | |
|---|---|
Object |
clone()
Return a clone of this instance. |
Object |
evaluate(IContext context)
Evaluate this function. |
IFunction |
getFunction()
|
void |
mix(IChromosome c1,
IChromosome c2,
boolean[] mask)
Mix the genes of the given chromosomes into this using the given mask. |
void |
mutate(double mutationRate,
double mutationMagnitude)
Mutate this chromosome's genes using the given parameters. |
void |
randomlyInitialize()
Initialize the genes with random values. |
void |
setFunction(IFunction function)
|
int |
size()
Return the number of genes. |
void |
splice(IChromosomeGP chromosome0,
IChromosomeGP chromosome1,
int cut0,
int cut1)
Splice the given chromosomes into this using the given cut index. |
void |
splice(IChromosome c1,
IChromosome c2,
int cut)
Splice the given chromosomes into this using the given cut index. |
String |
toString()
Return a string representation of this object. |
| Methods inherited from class org.vizzini.ai.geneticalgorithm.AbstractChromosome |
|---|
addFitness, compareTo, copy, equals, getDescription, getFitness, hashCode, isFitnessUnknown, mix, setDescription, setFitness, setFitnessUnknown |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.vizzini.ai.geneticalgorithm.IChromosome |
|---|
addFitness, copy, equals, getDescription, getFitness, isFitnessUnknown, mix, setDescription, setFitness, setFitnessUnknown |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
public AbstractChromosomeGP()
public AbstractChromosomeGP(IFunction function)
function - Function.| Method Detail |
|---|
public Object clone()
clone in interface IChromosomeclone in class AbstractChromosomepublic Object evaluate(IContext context)
evaluate in interface IChromosomeGPcontext - Context in which to evaluate.public IFunction getFunction()
getFunction in interface IChromosomeGP
public void mix(IChromosome c1,
IChromosome c2,
boolean[] mask)
mix in interface IChromosome
public void mutate(double mutationRate,
double mutationMagnitude)
mutate in interface IChromosomemutationRate - Probability of a gene being mutated.mutationMagnitude - The maximum allowed magnitude of the mutation.public void randomlyInitialize()
IFunctionGenerator, so
this method does nothing.
randomlyInitialize in interface IChromosomepublic void setFunction(IFunction function)
setFunction in interface IChromosomeGPfunction - the function to setpublic int size()
size in interface IChromosome
public void splice(IChromosome c1,
IChromosome c2,
int cut)
splice in interface IChromosome
public void splice(IChromosomeGP chromosome0,
IChromosomeGP chromosome1,
int cut0,
int cut1)
splice in interface IChromosomeGPpublic String toString()
toString in class AbstractChromosome
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |