es.udc.gii.common.eaf.algorithm.mga
Class MGAAlgorithm

java.lang.Object
  extended by java.util.Observable
      extended by es.udc.gii.common.eaf.algorithm.EvolutionaryAlgorithm
          extended by es.udc.gii.common.eaf.algorithm.GeneticAlgorithm
              extended by es.udc.gii.common.eaf.algorithm.mga.AbstractMGAAlgorithm
                  extended by es.udc.gii.common.eaf.algorithm.mga.MGAAlgorithm
All Implemented Interfaces:
Configurable

public class MGAAlgorithm
extends AbstractMGAAlgorithm

This class implements a micro-genetic algorithm as defined by Krishnakumar in "Micro-genetic algorithms for stationary and non-stationary function optimization".

The user has to provide a comparator, a stoptest defining nominal convergence, and the number of individuals that are preserved among generations (elitism). The user is free to provide some initial solutions that will be used as a startpoint for the search. Note: The initial solutions are changed internally. The user should not expect to get the same solutions he passed when invoking the getter method once the search has begun.

Good results have been achieved using elitism of 1, DeterministicTournamentSelection and elitism replace (for non-stationary problems use an elitism with reevaluation of the best individuals). For convergence: BitwiseConvergence (convergence rate between 0.6 and 0.9) or MicroGenerationsConvergence (~2 generations).

Author:
Rafael Tedin Alvarez

Field Summary
 
Fields inherited from class es.udc.gii.common.eaf.algorithm.EvolutionaryAlgorithm
CLOSE_LOGS_STATE, EVALUATE_STATE, FINAL_STATE, generations, INIT_EVALUATE_STATE, INIT_STATE, REPLACE_STATE, REPRODUCTION_STATE, SELECT_STATE, state
 
Constructor Summary
MGAAlgorithm()
          Creates a new instance of MGAAlgorithm
 
Method Summary
protected  void afterMicroEvolution()
          Performs the operations needed after a micro-evolution.
private  boolean assertPopulationSizeConstant(int required)
          Checks that the population size is constant.
protected  void beforeMicroEvolution()
          Performs the operations needed for the next micro-evolution.
 java.lang.String getAlgorithmID()
           
 java.lang.String toString()
           
 
Methods inherited from class es.udc.gii.common.eaf.algorithm.mga.AbstractMGAAlgorithm
configure, getElitism, getInitialSolutions, getMicrogenerations, getNominalConvergence, init, resolve, setElitism, setInitialSolutions, setMicrogenerations, setNominalConvergence
 
Methods inherited from class es.udc.gii.common.eaf.algorithm.EvolutionaryAlgorithm
evaluate, evaluate, evaluate, getBestIndividual, getComparator, getEvalChain, getEvaluationStrategy, getFEs, getFinish, getGenerations, getMaxGenerations, getPopulation, getProblem, getReplaceChain, getReproductionChain, getSelectionChain, getState, getStopTest, getUserTag, replace, reproduce, resolve, select, setComparator, setEvalChain, setEvaluationStrategy, setFEs, setFinish, setMaxGenerations, setPopulation, setProblem, setReplaceChain, setReproductionChain, setSelectionChain, setUserTag, updateParameters
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MGAAlgorithm

public MGAAlgorithm()
Creates a new instance of MGAAlgorithm

Method Detail

assertPopulationSizeConstant

private boolean assertPopulationSizeConstant(int required)
Checks that the population size is constant.


beforeMicroEvolution

protected void beforeMicroEvolution()
Performs the operations needed for the next micro-evolution.

Specified by:
beforeMicroEvolution in class AbstractMGAAlgorithm

afterMicroEvolution

protected void afterMicroEvolution()
Performs the operations needed after a micro-evolution.

Specified by:
afterMicroEvolution in class AbstractMGAAlgorithm

getAlgorithmID

public java.lang.String getAlgorithmID()
Overrides:
getAlgorithmID in class GeneticAlgorithm

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object