Class BaseMOEAD<S extends org.uma.jmetal.solution.Solution<?>>
- Type Parameters:
S- the type of solutions handled by this algorithm, must extendSolution
- All Implemented Interfaces:
BaseLevelAlgorithm<S>
- Direct Known Subclasses:
BinaryMOEAD,DoubleMOEAD,PermutationMOEAD
This class provides a flexible and extensible implementation of the MOEA/D framework, supporting various decomposition-based multi-objective optimization approaches. It manages the configuration and assembly of the main algorithm components through a parameter space.
Key features include:
- Decomposition-based optimization using weight vectors
- Configurable aggregation functions
- Neighborhood-based mating and replacement
- Support for external archives
- Flexible termination conditions
Example usage:
// Create a problem instance
Problem<DoubleSolution> problem = new MyMultiObjectiveProblem();
// Configure the algorithm
int populationSize = 100;
int maxEvaluations = 25000;
String weightVectorsDir = "src/main/resources/weightVectors";
ParameterSpace parameterSpace = new MOEADCommonParameterSpace<>();
// Create and run the algorithm
BaseMOEAD<DoubleSolution> moead = new MOEADDouble(problem, populationSize, maxEvaluations,
weightVectorsDir, parameterSpace);
EvolutionaryAlgorithm<DoubleSolution> algorithm = moead.build();
algorithm.run();
// Get results
List<DoubleSolution> population = algorithm.result();
Subclasses must implement the setNonConfigurableParameters() method to set any
parameters that are fixed or derived from the problem instance. If no such parameters exist, the
implementation can be left empty.
- Since:
- version
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.uma.jmetal.util.aggregationfunction.AggregationFunctionAggregation function for scalarizing objectives.protected intThe maximum number of evaluations allowed for the algorithm.protected intMaximum number of solutions to replace in the neighborhood.protected org.uma.jmetal.util.neighborhood.Neighborhood<S> Neighborhood structure for solution interactions.protected booleanFlag indicating whether objectives should be normalized.protected final ParameterSpaceThe parameter space containing all configurable components and parameters.protected intThe size of the population.protected org.uma.jmetal.problem.Problem<S> The optimization problem to be solved.protected org.uma.jmetal.util.sequencegenerator.SequenceGenerator<Integer> Generator for subproblem indices.protected StringDirectory containing the weight vector files. -
Constructor Summary
ConstructorsConstructorDescriptionBaseMOEAD(int populationSize, String weightVectorFilesDirectory, ParameterSpace parameterSpace) Constructs a new BaseMOEAD instance with the specified population size, weight vector directory, and parameter space.BaseMOEAD(org.uma.jmetal.problem.Problem<S> problem, int populationSize, int maximumNumberOfEvaluations, String weightVectorFilesDirectory, ParameterSpace parameterSpace) Constructs a fully configured BaseMOEAD instance ready for execution. -
Method Summary
Modifier and TypeMethodDescriptionorg.uma.jmetal.component.algorithm.EvolutionaryAlgorithm<S> build()Builds and configures the MOEA/D algorithm based on the current parameter space.protected org.uma.jmetal.component.catalogue.common.evaluation.Evaluation<S> createEvaluation(org.uma.jmetal.util.archive.Archive<S> archive) Creates the evaluation component for the algorithm.protected org.uma.jmetal.component.catalogue.common.solutionscreation.SolutionsCreation<S> Creates the component responsible for generating the initial population of solutions.protected org.uma.jmetal.component.catalogue.ea.replacement.Replacement<S> createReplacement(org.uma.jmetal.component.catalogue.ea.selection.Selection<S> selection) Creates the replacement operator for the algorithm using ranking and density estimators.protected org.uma.jmetal.component.catalogue.common.termination.TerminationCreates the termination condition for the algorithm.protected abstract org.uma.jmetal.component.catalogue.ea.variation.Variation<S> Creates the variation operator for the algorithm.protected org.uma.jmetal.util.neighborhood.Neighborhood<S> Creates the neighborhood structure for solution interactions.Returns the parameter space used by this algorithm.protected abstract voidConfigures any parameters that are fixed or derived from the problem instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.uma.evolver.algorithm.base.BaseLevelAlgorithm
createInstance, parse
-
Field Details
-
parameterSpace
The parameter space containing all configurable components and parameters. -
problem
The optimization problem to be solved. -
populationSize
protected int populationSizeThe size of the population. -
maximumNumberOfEvaluations
protected int maximumNumberOfEvaluationsThe maximum number of evaluations allowed for the algorithm. -
weightVectorFilesDirectory
Directory containing the weight vector files. -
subProblemIdGenerator
Generator for subproblem indices. -
neighborhood
protected org.uma.jmetal.util.neighborhood.Neighborhood<S extends org.uma.jmetal.solution.Solution<?>> neighborhoodNeighborhood structure for solution interactions. -
maximumNumberOfReplacedSolutions
protected int maximumNumberOfReplacedSolutionsMaximum number of solutions to replace in the neighborhood. -
aggregationFunction
protected org.uma.jmetal.util.aggregationfunction.AggregationFunction aggregationFunctionAggregation function for scalarizing objectives. -
normalizedObjectives
protected boolean normalizedObjectivesFlag indicating whether objectives should be normalized.
-
-
Constructor Details
-
BaseMOEAD
public BaseMOEAD(int populationSize, String weightVectorFilesDirectory, ParameterSpace parameterSpace) Constructs a new BaseMOEAD instance with the specified population size, weight vector directory, and parameter space.Note: This creates a partially configured instance. The
BaseLevelAlgorithm.createInstance(Problem, int)method must be called with a problem instance before the algorithm can be used.- Parameters:
populationSize- the size of the population. Must be positive.weightVectorFilesDirectory- the directory containing weight vector files. Must not be null.parameterSpace- the parameter space containing configuration parameters for the algorithm. Must not be null.- Throws:
IllegalArgumentException- if populationSize is not positive, or if any parameter is nullIllegalStateException- if the weight vector files cannot be found or parsed
-
BaseMOEAD
public BaseMOEAD(org.uma.jmetal.problem.Problem<S> problem, int populationSize, int maximumNumberOfEvaluations, String weightVectorFilesDirectory, ParameterSpace parameterSpace) Constructs a fully configured BaseMOEAD instance ready for execution.- Parameters:
problem- the optimization problem to be solved. Must not be null.populationSize- the size of the population. Must be positive.maximumNumberOfEvaluations- the maximum number of evaluations allowed for the algorithm. Must be positive and greater than populationSize.weightVectorFilesDirectory- the directory containing weight vector files. Must not be null.parameterSpace- the parameter space containing configuration parameters for the algorithm. Must not be null.- Throws:
IllegalArgumentException- if any parameter is invalid (null or non-positive values where required)IllegalStateException- if the weight vector files cannot be found or parsed
-
-
Method Details
-
parameterSpace
Returns the parameter space used by this algorithm.- Specified by:
parameterSpacein interfaceBaseLevelAlgorithm<S extends org.uma.jmetal.solution.Solution<?>>- Returns:
- the parameter space containing all configurable components and parameters
-
setNonConfigurableParameters
protected abstract void setNonConfigurableParameters()Configures any parameters that are fixed or derived from the problem instance.Subclasses must implement this method to set non-configurable parameters before building the algorithm. If there are not non-configurable parameters, the implementation of this method will be empty.
-
build
Builds and configures the MOEA/D algorithm based on the current parameter space.This method initializes all necessary components for the MOEA/D algorithm, including:
- Termination condition based on maximum evaluations
- Solution evaluation strategy
- Initial population generation
- Variation operators (crossover and mutation)
- Selection mechanism for parent solutions
- Replacement strategy for updating the population
- Optional external archive for storing non-dominated solutions
- Specified by:
buildin interfaceBaseLevelAlgorithm<S extends org.uma.jmetal.solution.Solution<?>>- Returns:
- a fully configured EvolutionaryAlgorithm instance implementing MOEA/D
- Throws:
IllegalStateException- if required parameters are not properly configured
-
createReplacement
-
createVariation
Creates the variation operator for the algorithm.Subclasses must implement this method to provide the specific variation operator (typically a combination of crossover and mutation) appropriate for the solution type. The implementation should configure the variation operator using parameters from the parameter space and add any required non-configurable parameters.
- Returns:
- a variation operator for creating new solutions
-
getNeighborhood
Creates the neighborhood structure for solution interactions.This method creates a weight vector neighborhood based on the population size and number of objectives in the problem. If the problem has two objectives, a simple weight vector neighborhood is created; otherwise, a weight vector neighborhood with a specified size is created.
- Returns:
- a neighborhood structure for solution interactions
-
createTermination
protected org.uma.jmetal.component.catalogue.common.termination.Termination createTermination()Creates the termination condition for the algorithm.This implementation creates a termination condition based on the maximum number of evaluations specified during construction. The algorithm will stop once this number of solution evaluations is reached.
- Returns:
- a termination condition based on evaluation count
- See Also:
-
createInitialSolutions
protected org.uma.jmetal.component.catalogue.common.solutionscreation.SolutionsCreation<S> createInitialSolutions()Creates the component responsible for generating the initial population of solutions.This method retrieves the solution creation strategy from the parameter space and configures it with the problem and population size.
- Returns:
- a component for creating the initial population
- Throws:
IllegalStateException- if the parameter space does not contain the required parameter
-
createEvaluation
protected org.uma.jmetal.component.catalogue.common.evaluation.Evaluation<S> createEvaluation(org.uma.jmetal.util.archive.Archive<S> archive) Creates the evaluation component for the algorithm.This method creates an evaluation component that can optionally update an external archive with non-dominated solutions during the evaluation process. If no archive is provided, a simple sequential evaluation is used.
- Parameters:
archive- the external archive to update with evaluated solutions, or null if no archive is used- Returns:
- an evaluation component configured with the problem and optional archive
- See Also:
-