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. Configuration example:

 <Elitism>1</Elitism>
 <NominalConvergence>
    <Class> ... </Class>
    ...
 </NominalConvergence>
 
The Elitism parameter defines the elitism for this algorithm. Each subclass determines the concrete meaning of this parameter.

The NominalConvergence The stop test that states that nominal convergence has been reached for the current micro-evolution. The class name is given by the Class tag.

Since:
1.0
Author:
Grupo Integrado de IngenierĂ­a (www.gii.udc.es)

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)
          Sets the elitism for this algorithm.
 void setInitialSolutions(java.util.List<Individual> initialSolutions)
          Sets the initial solutions for the next micro evolution.
 void setMicrogenerations(int microgenerations)
          Sets The current amount of micro generations.
 void setNominalConvergence(StopTest nominalConvergence)
          Sets the stop test for nominal convergence.
 
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, setStopTest, 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
Parameters:
conf - a Configuration object.
See Also:
Configuration

getInitialSolutions

public java.util.List<Individual> getInitialSolutions()
Returns:
The initial solutions for the next micro evolution.

setInitialSolutions

public void setInitialSolutions(java.util.List<Individual> initialSolutions)
Sets the initial solutions for the next micro evolution.

Parameters:
initialSolutions - The new initial solutions.

getElitism

public int getElitism()
Returns:
The elitism.

setElitism

public void setElitism(int elitism)
Sets the elitism for this algorithm.

Parameters:
elitism - The new elitism.

getMicrogenerations

public int getMicrogenerations()
Returns:
The current amount of micro generations.

setMicrogenerations

public void setMicrogenerations(int microgenerations)
Sets The current amount of micro generations.

Parameters:
microgenerations - The new amount of micro generations.

getNominalConvergence

public StopTest getNominalConvergence()
Returns:
The stop test for nominal convergence.

setNominalConvergence

public void setNominalConvergence(StopTest nominalConvergence)
Sets the stop test for nominal convergence.

Parameters:
nominalConvergence -