
MOEA Framework 2.12 API Specification 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.moeaframework.algorithm.AbstractAlgorithm org.moeaframework.algorithm.AbstractEvolutionaryAlgorithm org.moeaframework.algorithm.SPEA2
public class SPEA2
Implementation of the strengthbased evolutionary algorithm (SPEA2). SPEA2 uses a novel strengthbased measure of fitness for handling multiple objectives.
Note: First, there is a naming difference between this implementation and
the original SPEA2 paper. The original SPEA2 paper defines a "population"
and an "archive", but the population is really the offspring and the archive
is the population. Secondly, the SPEA2 paper defines a parameter
k = sqrt(population.size())
for computing a crowdingbased niching
factor. The SPEA2 C implementation in PISA (written by the same authors
as the paper) recommends using k=1
for performance reasons. This
implementation makes k
a userspecified parameter to support either
option. k
should be at least 1
and no larger than
population.size()
.
References:
Nested Class Summary  

static class 
SPEA2.MutableDistanceMap
Mapping of pairwise distances between points. 
class 
SPEA2.StrengthFitnessEvaluator
Fitness evaluator for the strength measure with crowdingbased niching. 
Field Summary  

protected FitnessComparator 
fitnessComparator
Compares solutions based on strength. 
protected SPEA2.StrengthFitnessEvaluator 
fitnessEvaluator
Strengthbased fitness evaluator. 
Fields inherited from class org.moeaframework.algorithm.AbstractEvolutionaryAlgorithm 

archive, initialization, population 
Fields inherited from class org.moeaframework.algorithm.AbstractAlgorithm 

initialized, numberOfEvaluations, problem, terminated 
Constructor Summary  

SPEA2(Problem problem,
Initialization initialization,
Variation variation,
int numberOfOffspring,
int k)
Constructs a new instance of SPEA2. 
Method Summary  

protected double[][] 
computeDistanceMatrix(Population population)
Computes the distance matrix containing the pairwise distances between solutions in objective space. 
protected void 
initialize()
Performs any initialization that is required by this algorithm. 
protected void 
iterate()
Performs one iteration of the algorithm. 
protected Population 
truncate(Population offspring,
int size)
Returns the population of solutions that survive to the next generation. 
Methods inherited from class org.moeaframework.algorithm.AbstractEvolutionaryAlgorithm 

getArchive, getPopulation, getResult, getState, setState 
Methods inherited from class org.moeaframework.algorithm.AbstractAlgorithm 

evaluate, evaluateAll, evaluateAll, finalize, getNumberOfEvaluations, getProblem, isInitialized, isTerminated, step, terminate 
Methods inherited from class java.lang.Object 

clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Methods inherited from interface org.moeaframework.core.Algorithm 

evaluate, getNumberOfEvaluations, getProblem, isTerminated, step, terminate 
Field Detail 

protected final SPEA2.StrengthFitnessEvaluator fitnessEvaluator
protected final FitnessComparator fitnessComparator
Constructor Detail 

public SPEA2(Problem problem, Initialization initialization, Variation variation, int numberOfOffspring, int k)
problem
 the probleminitialization
 the initialization procedurevariation
 the variation operatornumberOfOffspring
 the number of offspring generated each iterationk
 niching parameter specifying that crowding is computed using
the k
th nearest neighbor, recommend k=1
Method Detail 

protected void initialize()
AbstractAlgorithm
AbstractAlgorithm.step()
, but may also be called manually prior to any invocations
of step
. Implementations should always invoke
super.initialize()
to ensure the hierarchy is initialized
correctly.
initialize
in class AbstractEvolutionaryAlgorithm
protected void iterate()
AbstractAlgorithm
iterate
in class AbstractAlgorithm
protected Population truncate(Population offspring, int size)
offspring
 all offspring solutionssize
 the number of solutions to retain
protected double[][] computeDistanceMatrix(Population population)
population
 the population of solutions

MOEA Framework 2.12 API Specification 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 