|
||||||||||
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.geneticalgorithm.example.PrimeGA
public class PrimeGA
Provides an example genetic algorithm which searches for prime numbers. This
example excercises the ChromosomeInt
and
AbstractGeneticAlgorithm
.
Field Summary |
---|
Fields inherited from class org.vizzini.ai.geneticalgorithm.AbstractGeneticAlgorithm |
---|
_crossoverFraction, _crossoverType, _elapsedTime, _generation |
Constructor Summary | |
---|---|
PrimeGA()
|
Method Summary | |
---|---|
protected IChromosome |
createChromosome()
Create a new chromosome. |
protected void |
evaluateFitness()
Evaluate the fitness of all chromosomes in the population. |
protected int |
getPerfectFitness()
Return the perfect fitness. |
static boolean |
isPrime(int value)
Return true if the given value is a prime number. |
static void |
main(String[] args)
Application method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PrimeGA()
Method Detail |
---|
public static boolean isPrime(int value)
public static final void main(String[] args)
protected IChromosome createChromosome()
createChromosome
in class AbstractGeneticAlgorithm
protected void evaluateFitness()
evaluateFitness
in class AbstractGeneticAlgorithm
protected int getPerfectFitness()
getPerfectFitness
in class AbstractGeneticAlgorithm
|
||||||||||
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 |