org.vizzini.ai.geneticalgorithm
Interface IGeneticAlgorithm

All Known Subinterfaces:
IGameGeneticAlgorithm, IGameGeneticAlgorithmGP, IGeneticAlgorithmGP
All Known Implementing Classes:
AbstractGameGeneticAlgorithm, AbstractGeneticAlgorithm, AbstractGeneticAlgorithmGP, Ant, CartCentering, CharacterRecognition, CharacterRecognitionGA, PrimeGA, SymbolicRegression, TicTacToeGeneticAlgorithm, TicTacToeGeneticAlgorithmGP, XOR

public interface IGeneticAlgorithm

Defines methods required by genetic algorithms.

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

Method Summary
 double getCrossoverFraction()
          Return the crossover fraction.
 CrossoverType getCrossoverType()
          Return the crossover type.
 long getElapsedTime()
          Return the elapsed time.
 int getGeneration()
          Return the number of generations run.
 IChromosome getMostFit()
          Return the most fit chromosome.
 double getMutationFraction()
           
 double getMutationMagnitude()
          Return the mutation magnitude.
 double getMutationRate()
          Return the mutation rate.
 int getPopulationSize()
          Return the population size.
 double getProcessingRate()
          Return the processing rate.
 void reset()
          Reset.
 int runGenerations(int numGenerations, int printFrequency)
          Run for the given number of generations.
 void setAverageCrossoverFraction(double averageCrossoverFraction)
           
 void setCrossoverFraction(double crossoverFraction)
          Set the crossover fraction.
 void setCrossoverType(CrossoverType crossoverType)
          Set the crossover type.
 void setDuplicateAllowed(boolean isDuplicateAllowed)
          Set the flag indicating whether duplicate chromosomes are allowed.
 void setMutationFraction(double mutationFraction)
           
 void setMutationMagnitude(double mutationMagnitude)
          Set the mutation magnitude.
 void setMutationRate(double mutationRate)
          Set the mutation rate.
 void setPopulationSize(int size)
          Set the population size.
 void writeReport()
          Write a report.
 

Method Detail

getCrossoverFraction

double getCrossoverFraction()
Return the crossover fraction.

Since:
v0.1

getCrossoverType

CrossoverType getCrossoverType()
Return the crossover type.

Since:
v0.1

getElapsedTime

long getElapsedTime()
Return the elapsed time.

Since:
v0.1

getGeneration

int getGeneration()
Return the number of generations run.

Since:
v0.1

getMostFit

IChromosome getMostFit()
Return the most fit chromosome.

Since:
v0.1

getMutationFraction

double getMutationFraction()
Returns:
Return mutationFraction.
Since:
v0.3

getMutationMagnitude

double getMutationMagnitude()
Return the mutation magnitude.

Since:
v0.1

getMutationRate

double getMutationRate()
Return the mutation rate.

Since:
v0.1

getPopulationSize

int getPopulationSize()
Return the population size.

Since:
v0.1

getProcessingRate

double getProcessingRate()
Return the processing rate.

Since:
v0.1

reset

void reset()
Reset.

Since:
v0.1

runGenerations

int runGenerations(int numGenerations,
                   int printFrequency)
Run for the given number of generations.

Parameters:
numGenerations - Number of generations to run.
printFrequency - Print frequency.
Since:
v0.1

setAverageCrossoverFraction

void setAverageCrossoverFraction(double averageCrossoverFraction)
Parameters:
averageCrossoverFraction - The averageCrossoverFraction to set.

setCrossoverFraction

void setCrossoverFraction(double crossoverFraction)
Set the crossover fraction.

Parameters:
crossoverFraction - Number of chromosomes to form from crossover of the retained ones as a fraction of the population size.
Since:
v0.1

setCrossoverType

void setCrossoverType(CrossoverType crossoverType)
Set the crossover type.

Since:
v0.1

setDuplicateAllowed

void setDuplicateAllowed(boolean isDuplicateAllowed)
Set the flag indicating whether duplicate chromosomes are allowed.

Since:
v0.2

setMutationFraction

void setMutationFraction(double mutationFraction)
Parameters:
mutationFraction - the mutationFraction to set
Since:
v0.3

setMutationMagnitude

void setMutationMagnitude(double mutationMagnitude)
Set the mutation magnitude.

Parameters:
mutationMagnitude - The maximum allowed magnitude of the mutation.
Since:
v0.1

setMutationRate

void setMutationRate(double mutationRate)
Set the mutation rate.

Parameters:
mutationRate - Probability of a gene being mutated.
Since:
v0.1

setPopulationSize

void setPopulationSize(int size)
Set the population size.

Since:
v0.2

writeReport

void writeReport()
Write a report.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02