|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
es.udc.gii.common.eaf.algorithm.EvolutionaryAlgorithm
es.udc.gii.common.eaf.algorithm.GeneticAlgorithm
es.udc.gii.common.eaf.algorithm.mga.AbstractMGAAlgorithm
public abstract class AbstractMGAAlgorithm
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.
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 |
---|
private java.util.List<Individual> initialSolutions
private int elitism
private int microgenerations
private StopTest nominalConvergence
Constructor Detail |
---|
public AbstractMGAAlgorithm()
Method Detail |
---|
protected void init()
init
in class EvolutionaryAlgorithm
public void resolve(StopTest objective)
resolve
in class EvolutionaryAlgorithm
protected abstract void beforeMicroEvolution()
protected abstract void afterMicroEvolution()
public void configure(org.apache.commons.configuration.Configuration conf)
configure
in interface Configurable
configure
in class EvolutionaryAlgorithm
conf
- a Configuration object.Configuration
public java.util.List<Individual> getInitialSolutions()
public void setInitialSolutions(java.util.List<Individual> initialSolutions)
initialSolutions
- The new initial solutions.public int getElitism()
public void setElitism(int elitism)
elitism
- The new elitism.public int getMicrogenerations()
public void setMicrogenerations(int microgenerations)
microgenerations
- The new amount of micro generations.public StopTest getNominalConvergence()
public void setNominalConvergence(StopTest nominalConvergence)
nominalConvergence
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |