Class DoubleNSGAII
- All Implemented Interfaces:
BaseLevelAlgorithm<org.uma.jmetal.solution.doublesolution.DoubleSolution>
This class extends the base BaseNSGAII implementation to handle double-encoded
solutions, providing specialized support for continuous optimization problems with real-valued variables.
Key features include:
- Support for real-valued solution spaces
- Configurable genetic operators through the parameter space
- Automatic handling of solution bounds and constraints
- Integration with JMetal's double solution interface
- Support for various crossover and mutation operators
Example usage:
// Create a continuous problem instance
DoubleProblem problem = new MyDoubleProblem();
// Configure the algorithm
int populationSize = 100;
int maxEvaluations = 25000;
ParameterSpace parameterSpace = new NSGAIIDoubleParameterSpace();
// Configure parameter space with desired operators and parameters
// Create and run the algorithm
DoubleNSGAII algorithm = new DoubleNSGAII(problem, populationSize, maxEvaluations, parameterSpace);
algorithm.run();
// Get results
List<DoubleSolution> population = algorithm.result();
The algorithm automatically configures non-configurable parameters such as the number of variables and their bounds based on the problem definition. For mutation operators like non-uniform mutation, it also configures the maximum number of iterations based on the evaluation budget.
- Since:
- version
- See Also:
-
Field Summary
Fields inherited from class org.uma.evolver.algorithm.base.nsgaii.BaseNSGAII
densityEstimator, externalArchive, maximumNumberOfEvaluations, offspringPopulationSize, parameterSpace, populationSize, problem, ranking, rankingAndCrowdingComparator -
Constructor Summary
ConstructorsConstructorDescriptionDoubleNSGAII(int populationSize, ParameterSpace parameterSpace) Constructs a new instance of DoubleNSGAII with the specified population size and parameter space.DoubleNSGAII(org.uma.jmetal.problem.Problem<org.uma.jmetal.solution.doublesolution.DoubleSolution> problem, int populationSize, int maximumNumberOfEvaluations, ParameterSpace parameterSpace) Constructs a fully configured DoubleNSGAII instance ready for execution. -
Method Summary
Modifier and TypeMethodDescriptionBaseLevelAlgorithm<org.uma.jmetal.solution.doublesolution.DoubleSolution> createInstance(org.uma.jmetal.problem.Problem<org.uma.jmetal.solution.doublesolution.DoubleSolution> problem, int maximumNumberOfEvaluations) Creates and returns a new instance of DoubleNSGAII configured for the specified problem.protected voidConfigures non-configurable parameters based on the problem's characteristics.Methods inherited from class org.uma.evolver.algorithm.base.nsgaii.BaseNSGAII
build, createEvaluation, createExternalArchive, createInitialSolutions, createReplacement, createSelection, createTermination, createVariation, parameterSpaceMethods 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
parse
-
Constructor Details
-
DoubleNSGAII
Constructs a new instance of DoubleNSGAII with the specified population size and parameter space.Note: This creates a partially configured instance. The
createInstance(Problem, int)method must be called with a problem instance before the algorithm can be used.- Parameters:
populationSize- the size of the population to be used in the algorithm. Must be positive.parameterSpace- the parameter space containing configuration parameters for the algorithm. Must not be null.- Throws:
IllegalArgumentException- if populationSize is not positive or parameterSpace is null
-
DoubleNSGAII
public DoubleNSGAII(org.uma.jmetal.problem.Problem<org.uma.jmetal.solution.doublesolution.DoubleSolution> problem, int populationSize, int maximumNumberOfEvaluations, ParameterSpace parameterSpace) Constructs a fully configured DoubleNSGAII instance ready for execution.- Parameters:
problem- the continuous optimization problem to be solved. Must implement the DoubleProblem interface.populationSize- the size of the population. Must be a positive integer.maximumNumberOfEvaluations- the evaluation budget for the algorithm. The algorithm will terminate once this number of evaluations is reached.parameterSpace- the parameter space containing configuration parameters for the algorithm.- Throws:
IllegalArgumentException- if any parameter is invalid (null or non-positive values where required)ClassCastException- if the provided problem does not implement DoubleProblem
-
-
Method Details
-
createInstance
public BaseLevelAlgorithm<org.uma.jmetal.solution.doublesolution.DoubleSolution> createInstance(org.uma.jmetal.problem.Problem<org.uma.jmetal.solution.doublesolution.DoubleSolution> problem, int maximumNumberOfEvaluations) Creates and returns a new instance of DoubleNSGAII configured for the specified problem.This method implements the factory method pattern, allowing the creation of algorithm instances with the same configuration but potentially different problems or evaluation limits.
- Parameters:
problem- the continuous optimization problem to solve. Must not be null.maximumNumberOfEvaluations- the maximum number of evaluations allowed for the new instance. Must be positive.- Returns:
- a new, fully configured instance of DoubleNSGAII
- Throws:
IllegalArgumentException- if problem is null or maximumNumberOfEvaluations is not positive
-
setNonConfigurableParameters
protected void setNonConfigurableParameters()Configures non-configurable parameters based on the problem's characteristics.This method is automatically called during algorithm initialization to set up parameters that depend on the specific problem instance. It handles:
- Number of problem variables for mutation operators
- Maximum number of iterations for non-uniform mutation
- Perturbation values for uniform mutation
- Specified by:
setNonConfigurableParametersin classBaseNSGAII<org.uma.jmetal.solution.doublesolution.DoubleSolution>- Throws:
IllegalStateException- if required parameters are not properly configured
-