org.vizzini.ai.geneticalgorithm.example
Class CharacterRecognitionGA

java.lang.Object
  extended by org.vizzini.ai.geneticalgorithm.AbstractGeneticAlgorithm
      extended by org.vizzini.ai.geneticalgorithm.example.CharacterRecognitionGA
All Implemented Interfaces:
IGeneticAlgorithm

public class CharacterRecognitionGA
extends AbstractGeneticAlgorithm

Provides an example genetic algorithm which searches for a neural network which can identify seven digitized characters. This example excercises the ChromosomeNeuralNetwork and AbstractGeneticAlgorithm.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Field Summary
 
Fields inherited from class org.vizzini.ai.geneticalgorithm.AbstractGeneticAlgorithm
_crossoverFraction, _crossoverType, _elapsedTime, _generation
 
Constructor Summary
CharacterRecognitionGA()
           
 
Method Summary
protected static String arrayToString(double[] array)
           
protected  IChromosome createChromosome()
          Create a new chromosome.
protected  void evaluateFitness()
          Evaluate the fitness of all chromosomes in the population.
protected  int evaluateNetwork(INeuralNetwork network, double[] inputs, int target, boolean isPrinting)
          Evaluate the given neural network using the given inputs and target.
protected  int getPerfectFitness()
          Return the perfect fitness.
static void main(String[] args)
          Application method.
 
Methods inherited from class org.vizzini.ai.geneticalgorithm.AbstractGeneticAlgorithm
averageCrossover, fillPopulation, generateNewPopulation, getAverageCrossoverFraction, getCrossoverFraction, getCrossoverType, getElapsedTime, getGeneration, getMostFit, getMutationFraction, getMutationMagnitude, getMutationRate, getPopulation, getPopulationSize, getProcessingRate, isDuplicateAllowed, mutation, onePointCrossover, reproductionAndCrossover, reset, runGenerations, setAverageCrossoverFraction, setCrossoverFraction, setCrossoverType, setDuplicateAllowed, setMutationFraction, setMutationMagnitude, setMutationRate, setPopulation, setPopulationSize, sortPopulation, toString, uniformCrossover, writeReport, writeStats, writeStatsHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharacterRecognitionGA

public CharacterRecognitionGA()
Method Detail

main

public static final void main(String[] args)
Application method.

Since:
v0.3

arrayToString

protected static String arrayToString(double[] array)

createChromosome

protected IChromosome createChromosome()
Create a new chromosome.

Specified by:
createChromosome in class AbstractGeneticAlgorithm
Since:
v0.3

evaluateFitness

protected void evaluateFitness()
Evaluate the fitness of all chromosomes in the population.

Specified by:
evaluateFitness in class AbstractGeneticAlgorithm
Since:
v0.3

evaluateNetwork

protected int evaluateNetwork(INeuralNetwork network,
                              double[] inputs,
                              int target,
                              boolean isPrinting)
Evaluate the given neural network using the given inputs and target.

Since:
v0.3

getPerfectFitness

protected int getPerfectFitness()
Return the perfect fitness.

Overrides:
getPerfectFitness in class AbstractGeneticAlgorithm
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02