|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.ai.geneticalgorithm.AbstractGeneticAlgorithm
org.vizzini.ai.geneticprogramming.AbstractGeneticAlgorithmGP
org.vizzini.ai.geneticprogramming.example.CartCentering
public class CartCentering
Provides an example cart centering problem using genetic programming.
| Field Summary |
|---|
| Fields inherited from class org.vizzini.ai.geneticalgorithm.AbstractGeneticAlgorithm |
|---|
_crossoverFraction, _crossoverType, _elapsedTime, _generation |
| Constructor Summary | |
|---|---|
CartCentering()
Construct this object. |
|
| Method Summary | |
|---|---|
protected double |
computeError(Double x,
Double v)
Compute the error from the given parameters. |
protected IFitnessCase |
createFitnessCase(double x,
double v)
Create a fitness case for the given parameters. |
protected int |
evaluateFitness(int index,
IChromosomeGP chromosome,
boolean isPrinting)
Evaluate the fitness of the given chromosome for this problem. |
protected int |
getPerfectFitness()
Return the perfect fitness. |
protected Class |
getReturnType()
Return the overall return type for the chromosomes. |
static void |
main(String[] args)
Application method. |
| Methods inherited from class org.vizzini.ai.geneticprogramming.AbstractGeneticAlgorithmGP |
|---|
addFunction, addTerminal, createChromosome, evaluateFitness, getContext, getFunctionCount, getFunctionGenerator, getInitialMaxDepth, getTerminalCount, isSimpleBetter, onePointCrossover, penalizeComplexity, setContext, setInitialMaxDepth, setSimpleBetter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.vizzini.ai.geneticalgorithm.IGeneticAlgorithm |
|---|
getCrossoverFraction, getCrossoverType, getElapsedTime, getGeneration, getMostFit, getMutationFraction, getMutationMagnitude, getMutationRate, getPopulationSize, getProcessingRate, reset, runGenerations, setAverageCrossoverFraction, setCrossoverFraction, setCrossoverType, setDuplicateAllowed, setMutationFraction, setMutationMagnitude, setMutationRate, setPopulationSize, writeReport |
| Constructor Detail |
|---|
public CartCentering()
| Method Detail |
|---|
public static final void main(String[] args)
args - Input arguments.
protected double computeError(Double x,
Double v)
x - State variable X.v - State variable V.
protected IFitnessCase createFitnessCase(double x,
double v)
x - Initial position.v - Initial velocity.
protected int evaluateFitness(int index,
IChromosomeGP chromosome,
boolean isPrinting)
evaluateFitness in class AbstractGeneticAlgorithmGPchromosome - Chromosome.isPrinting - Flag indicating if the method should print.protected int getPerfectFitness()
getPerfectFitness in class AbstractGeneticAlgorithmprotected Class getReturnType()
getReturnType in class AbstractGeneticAlgorithmGP
|
||||||||||
| 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 |