Class AEvolutionaryAlgorithm
- java.lang.Object
-
- ai.libs.jaicore.ea.algorithm.moea.moeaframework.AbstractAlgorithm
-
- ai.libs.jaicore.ea.algorithm.moea.moeaframework.AEvolutionaryAlgorithm
-
- All Implemented Interfaces:
org.moeaframework.core.Algorithm,org.moeaframework.core.EvolutionaryAlgorithm
- Direct Known Subclasses:
NSGAII
public abstract class AEvolutionaryAlgorithm extends AbstractAlgorithm implements org.moeaframework.core.EvolutionaryAlgorithm
Abstract class providing default implementations for severalEvolutionaryAlgorithmmethods. Primarily, theinitialize()method generates and evaluates the initial population, adding the solutions to the archive if available. ThegetResult()method returns the non-dominated solutions from the population and, if available, the archive. The majority of evolutionary algorithms should only need to override theAbstractAlgorithm.iterate()method.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.moeaframework.core.NondominatedPopulationarchiveThe archive storing the non-dominated solutions.protected org.moeaframework.core.InitializationinitializationThe initialization operator.protected org.moeaframework.core.PopulationpopulationThe current population.-
Fields inherited from class ai.libs.jaicore.ea.algorithm.moea.moeaframework.AbstractAlgorithm
initialized, numberOfEvaluations, problem, terminated
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAEvolutionaryAlgorithm(org.moeaframework.core.Problem problem, org.moeaframework.core.Population population, org.moeaframework.core.NondominatedPopulation archive, org.moeaframework.core.Initialization initialization)Constructs an abstract evolutionary algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.moeaframework.core.NondominatedPopulationgetArchive()org.moeaframework.core.PopulationgetPopulation()org.moeaframework.core.NondominatedPopulationgetResult()java.io.SerializablegetState()protected voidinitialize()Performs any initialization that is required by this algorithm.voidsetState(java.lang.Object objState)-
Methods inherited from class ai.libs.jaicore.ea.algorithm.moea.moeaframework.AbstractAlgorithm
evaluate, evaluateAll, evaluateAll, getNumberOfEvaluations, getProblem, isInitialized, isTerminated, iterate, step, terminate
-
-
-
-
Field Detail
-
population
protected final org.moeaframework.core.Population population
The current population.
-
archive
protected final org.moeaframework.core.NondominatedPopulation archive
The archive storing the non-dominated solutions.
-
initialization
protected final org.moeaframework.core.Initialization initialization
The initialization operator.
-
-
Constructor Detail
-
AEvolutionaryAlgorithm
protected AEvolutionaryAlgorithm(org.moeaframework.core.Problem problem, org.moeaframework.core.Population population, org.moeaframework.core.NondominatedPopulation archive, org.moeaframework.core.Initialization initialization)Constructs an abstract evolutionary algorithm.- Parameters:
problem- the problem being solvedpopulation- the populationarchive- the archive storing the non-dominated solutionsinitialization- the initialization operator
-
-
Method Detail
-
getResult
public org.moeaframework.core.NondominatedPopulation getResult()
- Specified by:
getResultin interfaceorg.moeaframework.core.Algorithm
-
initialize
protected void initialize()
Description copied from class:AbstractAlgorithmPerforms any initialization that is required by this algorithm. This method is called automatically by the first invocation ofAbstractAlgorithm.step(), but may also be called manually prior to any invocations ofstep. Implementations should always invokesuper.initialize()to ensure the hierarchy is initialized correctly.- Overrides:
initializein classAbstractAlgorithm
-
getArchive
public org.moeaframework.core.NondominatedPopulation getArchive()
- Specified by:
getArchivein interfaceorg.moeaframework.core.EvolutionaryAlgorithm
-
getPopulation
public org.moeaframework.core.Population getPopulation()
- Specified by:
getPopulationin interfaceorg.moeaframework.core.EvolutionaryAlgorithm
-
getState
public java.io.Serializable getState() throws java.io.NotSerializableException- Specified by:
getStatein interfaceorg.moeaframework.core.Algorithm- Overrides:
getStatein classAbstractAlgorithm- Throws:
java.io.NotSerializableException
-
setState
public void setState(java.lang.Object objState) throws java.io.NotSerializableException- Specified by:
setStatein interfaceorg.moeaframework.core.Algorithm- Overrides:
setStatein classAbstractAlgorithm- Throws:
java.io.NotSerializableException
-
-