Package org.moeaframework.algorithm
Class MOEAD
java.lang.Object
org.moeaframework.algorithm.AbstractAlgorithm
org.moeaframework.algorithm.MOEAD
- All Implemented Interfaces:
Extensible
,Algorithm
,Configurable
,Stateful
Implementation of MOEA/D, the multiobjective evolutionary algorithm with decomposition. This implementation
supports two variants:
- With the default settings, this implementation is equivalent to MOEA/D-DE as specified in [1]. The "-DE" refers to the use of the differential evolutionary search operator.
- When given a non-negative
updateUtility
, this enables the utility-based search extension described in [2].
References:
- Li, H. and Zhang, Q. "Multiobjective Optimization problems with Complicated Pareto Sets, MOEA/D and NSGA-II." IEEE Transactions on Evolutionary Computation, 13(2):284-302, 2009.
- Zhang, Q., et al. "The Performance of a New Version of MOEA/D on CEC09 Unconstrained MOP Test Instances." IEEE Congress on Evolutionary Computation, 2009.
-
Field Summary
Fields inherited from class org.moeaframework.algorithm.AbstractAlgorithm
initialized, numberOfEvaluations, problem, terminated
-
Constructor Summary
ConstructorDescriptionConstructs the MOEA/D algorithm with default settings.MOEAD
(Problem problem, int initialPopulationSize, int neighborhoodSize, Initialization initialization, Variation variation, double delta, double eta) Constructs the MOEA/D algorithm with the specified components.MOEAD
(Problem problem, int initialPopulationSize, int neighborhoodSize, Initialization initialization, Variation variation, double delta, double eta, int updateUtility) Constructs the MOEA/D algorithm with the specified components.MOEAD
(Problem problem, int initialPopulationSize, int neighborhoodSize, WeightGenerator weightGenerator, Initialization initialization, Variation variation, double delta, double eta) Constructs the MOEA/D algorithm with the specified components.MOEAD
(Problem problem, int initialPopulationSize, int neighborhoodSize, WeightGenerator weightGenerator, Initialization initialization, Variation variation, double delta, double eta, int updateUtility) Constructs the MOEA/D algorithm with the specified components. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDelta()
Returns the probability of mating with a solution in the neighborhood rather than the entire population.double
getEta()
Returns the maximum number of population slots a solution can replace.Returns the initialization method for generating solutions in the initial population.int
Returns the initial population size.int
Returns the size of the neighborhood used for mating.Returns the current best-known result.int
Returns the frequency, in generations, in which utility values are updated.Returns the variation operator.Returns the weight generator method.void
Performs any initialization that is required by this algorithm.void
iterate()
Performs one iteration of the algorithm.void
loadState
(ObjectInputStream stream) Loads the state of this object from the stream.void
saveState
(ObjectOutputStream stream) Writes the state of this object to the stream.void
setDelta
(double delta) Sets the probability of mating with a solution in the neighborhood rather than the entire population.void
setEta
(double eta) Sets the maximum number of population slots a solution can replace.void
setInitialization
(Initialization initialization) Sets the initialization method for generating solutions in the initial population.void
setInitialPopulationSize
(int initialPopulationSize) Sets the initial population size.void
setNeighborhoodSize
(int neighborhoodSize) Sets the size of the neighborhood used for mating, which must be at leastvariation.getArity()-1
.void
setUpdateUtility
(int updateUtility) Sets the frequency, in generations, in which utility values are updated; set to50
to use the recommended update frequency or-1
to disable utility-based search.void
setVariation
(Variation variation) Sets the variation operator.void
setWeightGenerator
(WeightGenerator weightGenerator) Sets the weight generator, ornull
to use randomly-generated weights produced byRandomGenerator
.protected void
Updates the utility of each individual.Methods inherited from class org.moeaframework.algorithm.AbstractAlgorithm
assertNotInitialized, evaluate, getExtensions, getNumberOfEvaluations, getProblem, isInitialized, isTerminated, step, terminate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.core.Algorithm
evaluateAll, evaluateAll, run, run
Methods inherited from interface org.moeaframework.core.configuration.Configurable
applyConfiguration, getConfiguration
Methods inherited from interface org.moeaframework.algorithm.extension.Extensible
addExtension, removeExtension
-
Constructor Details
-
MOEAD
Constructs the MOEA/D algorithm with default settings.- Parameters:
problem
- the problem being solved
-
MOEAD
public MOEAD(Problem problem, int initialPopulationSize, int neighborhoodSize, Initialization initialization, Variation variation, double delta, double eta, int updateUtility) Constructs the MOEA/D algorithm with the specified components. This version of MOEA/D uses utility-based search as described in [2].- Parameters:
problem
- the problem being solvedinitialPopulationSize
- the initial population sizeneighborhoodSize
- the size of the neighborhood used for mating, which must be at leastvariation.getArity()-1
.initialization
- the initialization methodvariation
- the variation operatordelta
- the probability of mating with a solution in the neighborhood rather than the entire populationeta
- the maximum number of population slots a solution can replaceupdateUtility
- the frequency, in generations, in which utility values are updated; set to50
to use the recommended update frequency or-1
to disable utility-based search.
-
MOEAD
public MOEAD(Problem problem, int initialPopulationSize, int neighborhoodSize, Initialization initialization, Variation variation, double delta, double eta) Constructs the MOEA/D algorithm with the specified components. This constructs the original MOEA/D implementation without utility-based search.- Parameters:
problem
- the problem being solvedinitialPopulationSize
- the initial population sizeneighborhoodSize
- the size of the neighborhood used for mating, which must be at leastvariation.getArity()-1
.initialization
- the initialization methodvariation
- the variation operatordelta
- the probability of mating with a solution in the neighborhood rather than the entire populationeta
- the maximum number of population slots a solution can replace
-
MOEAD
public MOEAD(Problem problem, int initialPopulationSize, int neighborhoodSize, WeightGenerator weightGenerator, Initialization initialization, Variation variation, double delta, double eta, int updateUtility) Constructs the MOEA/D algorithm with the specified components. This version of MOEA/D uses utility-based search as described in [2].- Parameters:
problem
- the problem being solvedinitialPopulationSize
- the initial population sizeneighborhoodSize
- the size of the neighborhood used for mating, which must be at leastvariation.getArity()-1
.weightGenerator
- the weight generator, ornull
to use randomly-generated weightsinitialization
- the initialization method, which must generate the same number of solutions as weightsvariation
- the variation operatordelta
- the probability of mating with a solution in the neighborhood rather than the entire populationeta
- the maximum number of population slots a solution can replaceupdateUtility
- the frequency, in generations, in which utility values are updated; set to50
to use the recommended update frequency or-1
to disable utility-based search
-
MOEAD
public MOEAD(Problem problem, int initialPopulationSize, int neighborhoodSize, WeightGenerator weightGenerator, Initialization initialization, Variation variation, double delta, double eta) Constructs the MOEA/D algorithm with the specified components. By default, this constructs the original MOEA/D implementation without utility-based search.- Parameters:
problem
- the problem being solvedinitialPopulationSize
- the initial population sizeneighborhoodSize
- the size of the neighborhood used for mating, which must be at leastvariation.getArity()-1
.weightGenerator
- the weight generator, ornull
to use randomly-generated weightsinitialization
- the initialization method, which must generate the same number of solutions as weightsvariation
- the variation operatordelta
- the probability of mating with a solution in the neighborhood rather than the entire populationeta
- the maximum number of population slots a solution can replace
-
-
Method Details
-
getInitialPopulationSize
public int getInitialPopulationSize()Returns the initial population size.- Returns:
- the initial population size
-
setInitialPopulationSize
public void setInitialPopulationSize(int initialPopulationSize) Sets the initial population size. This value can not be set after initialization.- Parameters:
initialPopulationSize
- the initial population size
-
getNeighborhoodSize
public int getNeighborhoodSize()Returns the size of the neighborhood used for mating.- Returns:
- the neighborhood size
-
setNeighborhoodSize
public void setNeighborhoodSize(int neighborhoodSize) Sets the size of the neighborhood used for mating, which must be at leastvariation.getArity()-1
.- Parameters:
neighborhoodSize
- the neighborhood size
-
getDelta
public double getDelta()Returns the probability of mating with a solution in the neighborhood rather than the entire population.- Returns:
- the delta value
-
setDelta
public void setDelta(double delta) Sets the probability of mating with a solution in the neighborhood rather than the entire population.- Parameters:
delta
- the delta value
-
getEta
public double getEta()Returns the maximum number of population slots a solution can replace.- Returns:
- the eta value
-
setEta
public void setEta(double eta) Sets the maximum number of population slots a solution can replace.- Parameters:
eta
- the eta value
-
getUpdateUtility
public int getUpdateUtility()Returns the frequency, in generations, in which utility values are updated.- Returns:
- the nmber of generations between each utility update
-
setUpdateUtility
public void setUpdateUtility(int updateUtility) Sets the frequency, in generations, in which utility values are updated; set to50
to use the recommended update frequency or-1
to disable utility-based search.- Parameters:
updateUtility
- the number of generations between each utility update
-
getVariation
Returns the variation operator.- Returns:
- the variation operator
-
setVariation
Sets the variation operator. MOEA/D typically uses differential evolution but other variation operators are supported.- Parameters:
variation
- the variation to set
-
getInitialization
Returns the initialization method for generating solutions in the initial population.- Returns:
- the initialization method
-
setInitialization
Sets the initialization method for generating solutions in the initial population. This can only be set before initializing the algorithm.- Parameters:
initialization
- the initialization method
-
getWeightGenerator
Returns the weight generator method.- Returns:
- the weight generator
-
setWeightGenerator
Sets the weight generator, ornull
to use randomly-generated weights produced byRandomGenerator
. The number of weights produced must exactly match the initial population size. This can only be set before initializing the algorithm.- Parameters:
weightGenerator
- the weight generator
-
initialize
public void initialize()Description copied from interface:Algorithm
Performs any initialization that is required by this algorithm. This method should only be called once, though the specific implementation may choose to no-op or throwAlgorithmInitializationException
if called multiple times.Implementations should always call
super.initialize()
to ensure the algorithm is initialized correctly.- Specified by:
initialize
in interfaceAlgorithm
- Overrides:
initialize
in classAbstractAlgorithm
-
getResult
Description copied from interface:Algorithm
Returns the current best-known result. -
updateUtility
protected void updateUtility()Updates the utility of each individual. -
iterate
public void iterate()Description copied from class:AbstractAlgorithm
Performs one iteration of the algorithm. This method should be overridden by implementations to perform each logical iteration of the algorithm.- Specified by:
iterate
in classAbstractAlgorithm
-
saveState
Description copied from interface:Stateful
Writes the state of this object to the stream. The order that objects are written to the stream is important. We recommend first callingsuper.saveState(stream)
followed by writing each field.- Specified by:
saveState
in interfaceStateful
- Overrides:
saveState
in classAbstractAlgorithm
- Parameters:
stream
- the stream- Throws:
IOException
- if an I/O error occurred
-
loadState
Description copied from interface:Stateful
Loads the state of this object from the stream. The order for reading objects from the stream must match the order they are written to the stream inStateful.saveState(ObjectOutputStream)
.- Specified by:
loadState
in interfaceStateful
- Overrides:
loadState
in classAbstractAlgorithm
- Parameters:
stream
- the stream- Throws:
IOException
- if an I/O error occurredClassNotFoundException
- if the stream referenced a class that is not defined
-