Class BaseSMSEMOA<S extends org.uma.jmetal.solution.Solution<?>>
- Type Parameters:
S- the solution type handled by the algorithm
- All Implemented Interfaces:
BaseLevelAlgorithm<S>
- Direct Known Subclasses:
DoubleSMSEMOA
This class provides a flexible and extensible foundation for building SMS-EMOA variants for different solution types. It manages the configuration and assembly of the main algorithmic components (variation, selection, replacement, evaluation, termination, etc.) using a parameter space abstraction. SMS-EMOA is a steady-state MOEA that uses the hypervolume contribution as the main selection criterion.
Key features of this implementation include:
- Configurable variation operators (crossover and mutation)
- Support for external archives
- Flexible termination conditions
- Parameter space for easy configuration
Subclasses must implement the setNonConfigurableParameters() method to set any
parameters that are fixed or derived from the problem instance.
Typical usage involves:
- Creating a concrete subclass for a specific solution type (e.g., permutation, double).
- Configuring the parameter space and problem instance.
- Calling
build()to obtain a ready-to-runEvolutionaryAlgorithminstance.invalid input: '<'/n *
Example usage:
SMSEMOADouble algorithm = new SMSEMOADouble(problem, 100, 25000);
algorithm.parse(args);
EvolutionaryAlgorithm<DoubleSolution> smsemoa = algorithm.build();
smsemoa.run();
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final ParameterSpaceprotected intprotected org.uma.jmetal.problem.Problem<S> protected org.uma.jmetal.util.ranking.Ranking<S> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseSMSEMOA(int populationSize, ParameterSpace parameterSpace) Constructs an AbstractNSGAII with the given population size and parameter space.protectedBaseSMSEMOA(org.uma.jmetal.problem.Problem<S> problem, int populationSize, int maximumNumberOfEvaluations, ParameterSpace parameterSpace) Constructs an AbstractNSGAII with the given problem, population size, maximum number of evaluations, and parameter space. -
Method Summary
Modifier and TypeMethodDescriptionorg.uma.jmetal.component.algorithm.EvolutionaryAlgorithm<S> build()Builds and returns a configuredEvolutionaryAlgorithminstance using the current parameter space and problem settings.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.util.archive.Archive<S> Creates and configures the external archive if required by the parameter space.protected org.uma.jmetal.component.catalogue.common.solutionscreation.SolutionsCreation<S> Creates the initial solutions creation strategy using the configured parameter.protected org.uma.jmetal.component.catalogue.ea.replacement.Replacement<S> Creates the replacement operator for the algorithm using ranking and density estimators.protected org.uma.jmetal.component.catalogue.ea.selection.Selection<S> createSelection(org.uma.jmetal.component.catalogue.ea.variation.Variation<S> variation) Creates the selection operator for the algorithm using the configured selection parameter.protected org.uma.jmetal.component.catalogue.common.termination.TerminationCreates the termination condition for the algorithm.protected org.uma.jmetal.component.catalogue.ea.variation.Variation<S> Creates the variation operator for the algorithm using the configured variation parameter.Returns the parameter space associated with 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
-
ranking
protected org.uma.jmetal.util.ranking.Ranking<S extends org.uma.jmetal.solution.Solution<?>> ranking -
problem
-
populationSize
protected int populationSize -
maximumNumberOfEvaluations
protected int maximumNumberOfEvaluations
-
-
Constructor Details
-
BaseSMSEMOA
Constructs an AbstractNSGAII with the given population size and parameter space. This constructor is typically used when the problem and maximum number of evaluations will be set later.- Parameters:
populationSize- the population size to useparameterSpace- the parameter space for configuration
-
BaseSMSEMOA
protected BaseSMSEMOA(org.uma.jmetal.problem.Problem<S> problem, int populationSize, int maximumNumberOfEvaluations, ParameterSpace parameterSpace) Constructs an AbstractNSGAII with the given problem, population size, maximum number of evaluations, and parameter space. Initializes the ranking and density estimator components.- Parameters:
problem- the problem to solvepopulationSize- the population size to usemaximumNumberOfEvaluations- the maximum number of evaluationsparameterSpace- the parameter space for configuration
-
-
Method Details
-
parameterSpace
Returns the parameter space associated with this algorithm.- Specified by:
parameterSpacein interfaceBaseLevelAlgorithm<S extends org.uma.jmetal.solution.Solution<?>>- Returns:
- the parameter space
-
build
Builds and returns a configuredEvolutionaryAlgorithminstance using the current parameter space and problem settings.This method assembles all the main components of the NSGA-II algorithm, including archive, initial solutions creation, variation, selection, evaluation, replacement, and termination. Subclasses should ensure that all required parameters are set before calling this method.
- Specified by:
buildin interfaceBaseLevelAlgorithm<S extends org.uma.jmetal.solution.Solution<?>>- Returns:
- a ready-to-run evolutionary algorithm instance
-
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.
-
createExternalArchive
Creates and configures the external archive if required by the parameter space. The archive size is set according to the current population size.- Returns:
- the configured external archive, or
nullif not used
-
createTermination
protected org.uma.jmetal.component.catalogue.common.termination.Termination createTermination()Creates the termination condition for the algorithm. By default, termination is based on the maximum number of evaluations.- Returns:
- the termination condition
-
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. If an external archive is used, a sequential evaluation with archive is created; otherwise, a standard sequential evaluation is used.- Parameters:
archive- the external archive, ornullif not used- Returns:
- the evaluation component
-
createSelection
protected org.uma.jmetal.component.catalogue.ea.selection.Selection<S> createSelection(org.uma.jmetal.component.catalogue.ea.variation.Variation<S> variation) Creates the selection operator for the algorithm using the configured selection parameter. The mating pool size is obtained from the variation operator.- Parameters:
variation- the variation operator- Returns:
- the selection operator
-
createVariation
Creates the variation operator for the algorithm using the configured variation parameter. Sets the offspring population size as a non-configurable sub-parameter.- Returns:
- the variation operator
-
createInitialSolutions
protected org.uma.jmetal.component.catalogue.common.solutionscreation.SolutionsCreation<S> createInitialSolutions()Creates the initial solutions creation strategy using the configured parameter.- Returns:
- the solutions creation strategy
-
createReplacement
Creates the replacement operator for the algorithm using ranking and density estimators.- Returns:
- the replacement operator
-