JAGA Homepage

org.jaga.masterAlgorithm
Class SimpleGA

java.lang.Object
  extended by org.jaga.masterAlgorithm.SimpleGA
All Implemented Interfaces:
GeneticAlgorithm
Direct Known Subclasses:
ReusableSimpleGA

public class SimpleGA
extends java.lang.Object
implements GeneticAlgorithm

TODO: Complete these comments.

Project: JAGA - Java API for Genetic Algorithms.

Company: University College London and JAGA.Org (http://www.jaga.org).

Copyright: (c) 2004 by G. Paperin.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, ONLY if you include a note of the original author(s) in any redistributed/modified copy.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or see http://www.gnu.org/licenses/gpl.html

Version:
JAGA public release 1.0 beta
Author:
Greg Paperin (greg@jaga.org)

Field Summary
private  java.util.ArrayList hooks
           
 
Constructor Summary
SimpleGA()
           
 
Method Summary
 boolean addHook(SimpleGAHook hook)
           
protected  boolean checkForBetterResult(GAResult oldResult, Population newPop, GAParameterSet params)
           
protected  Population createEmptyPopulation(GAParameterSet params)
           
protected  Population createInitialPopulation(GAParameterSet params)
           
protected  GAResult createResult()
           
 GAResult exec(GAParameterSet params)
          Runs this master algorithm with the specified experimet paramenters.
protected  Population generateNextPopulation(Population oldPop, int age, GAResult result, GAParameterSet params)
           
protected  Individual[] haveSex(Individual[] parents, GAParameterSet params)
           
protected  void notifyFoundNewResult(Population pop, int age, GAResult result, GAParameterSet params)
           
protected  void notifyGenerationChanged(Population pop, int age, GAResult result, GAParameterSet params)
           
protected  void notifyInitialisationDone(Population pop, int age, GAResult result, GAParameterSet params)
           
protected  void notifyReproduced(Individual[] children, Individual[] parents, Population pop, int age, GAResult result, GAParameterSet params)
           
protected  void notifySelectedForReproduction(Individual[] selectedParents, Population pop, int age, GAResult result, GAParameterSet params)
           
protected  void notifyTerminationConditionApplies(Population pop, int age, GAResult result, GAParameterSet params)
           
 boolean removeHook(SimpleGAHook hook)
           
protected  Individual[] selectForReproduction(Population pop, int age, GAParameterSet params)
           
protected  boolean terminationConditionApplies(Population pop, int genNum, GAResult result, GAParameterSet params)
           
protected  void updateFitnessCalculated(Individual updated, Population pop, int age, GAParameterSet params)
           
protected  void updateIndividualFitness(Individual indiv, Population pop, int genNum, GAParameterSet params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hooks

private java.util.ArrayList hooks
Constructor Detail

SimpleGA

public SimpleGA()
Method Detail

exec

public GAResult exec(GAParameterSet params)
Description copied from interface: GeneticAlgorithm
Runs this master algorithm with the specified experimet paramenters.

Specified by:
exec in interface GeneticAlgorithm
Parameters:
params - The paramaters for this run.
Returns:
The resukt of the run.

generateNextPopulation

protected Population generateNextPopulation(Population oldPop,
                                            int age,
                                            GAResult result,
                                            GAParameterSet params)

createResult

protected GAResult createResult()

checkForBetterResult

protected boolean checkForBetterResult(GAResult oldResult,
                                       Population newPop,
                                       GAParameterSet params)

createInitialPopulation

protected Population createInitialPopulation(GAParameterSet params)

createEmptyPopulation

protected Population createEmptyPopulation(GAParameterSet params)

terminationConditionApplies

protected boolean terminationConditionApplies(Population pop,
                                              int genNum,
                                              GAResult result,
                                              GAParameterSet params)

selectForReproduction

protected Individual[] selectForReproduction(Population pop,
                                             int age,
                                             GAParameterSet params)

haveSex

protected Individual[] haveSex(Individual[] parents,
                               GAParameterSet params)

updateIndividualFitness

protected void updateIndividualFitness(Individual indiv,
                                       Population pop,
                                       int genNum,
                                       GAParameterSet params)

addHook

public boolean addHook(SimpleGAHook hook)

removeHook

public boolean removeHook(SimpleGAHook hook)

notifyInitialisationDone

protected void notifyInitialisationDone(Population pop,
                                        int age,
                                        GAResult result,
                                        GAParameterSet params)

notifyFoundNewResult

protected void notifyFoundNewResult(Population pop,
                                    int age,
                                    GAResult result,
                                    GAParameterSet params)

notifyGenerationChanged

protected void notifyGenerationChanged(Population pop,
                                       int age,
                                       GAResult result,
                                       GAParameterSet params)

notifyTerminationConditionApplies

protected void notifyTerminationConditionApplies(Population pop,
                                                 int age,
                                                 GAResult result,
                                                 GAParameterSet params)

notifySelectedForReproduction

protected void notifySelectedForReproduction(Individual[] selectedParents,
                                             Population pop,
                                             int age,
                                             GAResult result,
                                             GAParameterSet params)

notifyReproduced

protected void notifyReproduced(Individual[] children,
                                Individual[] parents,
                                Population pop,
                                int age,
                                GAResult result,
                                GAParameterSet params)

updateFitnessCalculated

protected void updateFitnessCalculated(Individual updated,
                                       Population pop,
                                       int age,
                                       GAParameterSet params)

JAGA Homepage

Go to JAGA Homepage