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

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
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
MGAAlgorithm, MMGAAlgorithm

public abstract class AbstractMGAAlgorithm
extends GeneticAlgorithm

This class implements the generic code for a micro-genetic algorithm.

For an implementation of a micro-genetic algorithm for singleobjective problems see MGAAlgorithm.

For an implementation of a micro-genetic algorithm for multiobjective problems see MMGAAlgorithm.

Author:
Rafael Tedin Alvarez

Field Summary
private  int elitism
          Defines the elitism.
private  java.util.List<Individual> initialSolutions
          The user can provide some initial solutions that must have been already evaluated.
private  int microgenerations
          Stores the current generations of the micro-evolution.
private  StopTest nominalConvergence
          The stop test that states that nominal convergence has been reached for the current micro-evolution.
 
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
AbstractMGAAlgorithm()
          Creates a new instance of AbstractMGAAlgorithm
 
Method Summary
protected abstract  void afterMicroEvolution()
          Performs the operations needed after a micro-evolution.
protected abstract  void beforeMicroEvolution()
          Performs the operations needed for the next micro-evolution.
 void configure(org.apache.commons.configuration.Configuration conf)
          Configures the algorithm.
 int getElitism()
           
 java.util.List<Individual> getInitialSolutions()
           
 int getMicrogenerations()
           
 StopTest getNominalConvergence()
           
protected  void init()
          Initialization.
 void resolve(StopTest objective)
          Performs the algorithm.
 void setElitism(int elitism)
           
 void setInitialSolutions(java.util.List<Individual> initialSolutions)
           
 void setMicrogenerations(int microgenerations)
           
 void setNominalConvergence(StopTest nominalConvergence)
           
 
Methods inherited from class es.udc.gii.common.eaf.algorithm.GeneticAlgorithm
getAlgorithmID
 
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, toString, wait, wait, wait
 

Field Detail

initialSolutions

private java.util.List<Individual> initialSolutions
The user can provide some initial solutions that must have been already evaluated.


elitism

private int elitism
Defines the elitism. Each subclass gives the concrete meaning of this parameter. (Configuration parameter).


microgenerations

private int microgenerations
Stores the current generations of the micro-evolution.


nominalConvergence

private StopTest nominalConvergence
The stop test that states that nominal convergence has been reached for the current micro-evolution. (Configuration parameter).

Constructor Detail

AbstractMGAAlgorithm

public AbstractMGAAlgorithm()
Creates a new instance of AbstractMGAAlgorithm

Method Detail

init

protected void init()
Initialization.

Overrides:
init in class EvolutionaryAlgorithm

resolve

public void resolve(StopTest objective)
Performs the algorithm.

Overrides:
resolve in class EvolutionaryAlgorithm

beforeMicroEvolution

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


afterMicroEvolution

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


configure

public void configure(org.apache.commons.configuration.Configuration conf)
Configures the algorithm.

Specified by:
configure in interface Configurable
Overrides:
configure in class EvolutionaryAlgorithm

getInitialSolutions

public java.util.List<Individual> getInitialSolutions()

setInitialSolutions

public void setInitialSolutions(java.util.List<Individual> initialSolutions)

getElitism

public int getElitism()

setElitism

public void setElitism(int elitism)

getMicrogenerations

public int getMicrogenerations()

setMicrogenerations

public void setMicrogenerations(int microgenerations)

getNominalConvergence

public StopTest getNominalConvergence()

setNominalConvergence

public void setNominalConvergence(StopTest nominalConvergence)