evSOLve.JEvolution
Class JEvolution

java.lang.Object
  |
  +--evSOLve.JEvolution.JEvolution

public class JEvolution
extends java.lang.Object

A quite general implementation of an Evolutionary Algorithm.

Since:
September 27, 1999
Version:
0.4
Author:
Helmut A. Mayer

Constructor Summary
JEvolution()
          The minimal constructor, all GA parameters are set to default values.
 
Method Summary
 void addChromosome(Chromosome chromosome)
          Add a JEvolution native or a custom Chromosome to the Genotype.
 void doEvolve()
          The evolutionary cycle.
 boolean getChromosomeShuffling()
          Get status of Chromosome shuffling.
 java.lang.Object getJEvolutionReporter()
          Access statistics.
 int getNumberOfGenerations()
          Gives number of generations.
 int getNumberOfRuns()
          Access number of evolutionary runs.
 int getPopulationSize()
          Gives population size.
 void setChromosomeShuffling(boolean on)
          Switches Chromosome shuffling on/off.
 void setNumberOfGenerations(int numberOfGenerations)
          Changes number of generations.
 void setNumberOfRuns(int numberOfRuns)
          Change number of evolutionary runs.
 void setPhenotype(Phenotype phenotype)
          Set the Phenotype with all the problem-specific code.
 void setPopulationSize(int populationSize)
          Changes population size.
 void setSelection(Selection selection)
          Set Selection type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JEvolution

public JEvolution()
The minimal constructor, all GA parameters are set to default values. Number of runs = 1, population size = 50, number of generations = 50, binary tournament selection.
Method Detail

doEvolve

public void doEvolve()
The evolutionary cycle.

addChromosome

public void addChromosome(Chromosome chromosome)
Add a JEvolution native or a custom Chromosome to the Genotype. This way a JEvolution genotype can contain an arbitrary number of Chromosomes, but for writing a proper Phenotype class, the user has to be aware of the order of the chromsomes which corresponds to the order of adding it to the genotype. There is no restriction on the type of Chromosomes, i.e., you can use different Chromosomes in a genotype. Crossover is done separately for each Chromosome (with specific parameters set by the user). You may also shuffle Chromosomes.
Parameters:
chromosome - JEvolution native or costum Chromosome
See Also:
Phenotype.doOntogeny(java.util.Vector), setChromosomeShuffling(boolean)

setPhenotype

public void setPhenotype(Phenotype phenotype)
Set the Phenotype with all the problem-specific code.
Parameters:
phenotype - Fitness code provided by user.

setSelection

public void setSelection(Selection selection)
Set Selection type.
Parameters:
selection - native or custom selection method

getNumberOfRuns

public int getNumberOfRuns()
Access number of evolutionary runs.

setNumberOfRuns

public void setNumberOfRuns(int numberOfRuns)
                     throws JEvolutionException
Change number of evolutionary runs.
Parameters:
numberOfRuns - The number of runs.

getPopulationSize

public int getPopulationSize()
Gives population size.

setPopulationSize

public void setPopulationSize(int populationSize)
                       throws JEvolutionException
Changes population size.
Parameters:
populationSize - number of individuals
Throws:
JEvolutionException - invalid size

getNumberOfGenerations

public int getNumberOfGenerations()
Gives number of generations.

setNumberOfGenerations

public void setNumberOfGenerations(int numberOfGenerations)
                            throws JEvolutionException
Changes number of generations.
Parameters:
numberOfGenerations - generations per run
Throws:
JEvolutionException - meaningless number

getChromosomeShuffling

public boolean getChromosomeShuffling()
Get status of Chromosome shuffling.

setChromosomeShuffling

public void setChromosomeShuffling(boolean on)
Switches Chromosome shuffling on/off. Shuffling is only meaningful, if you use more than one Chromosome for your genotype. If Chromosomes are shuffled, equivalent Chromosomes are exchanged randomly between the parents (with probability 0.5).
Parameters:
on - turns it on/off
See Also:
addChromosome(evSOLve.JEvolution.Chromosome)

getJEvolutionReporter

public java.lang.Object getJEvolutionReporter()
Access statistics.