Package org.uma.evolver.algorithm.meta
Class MetaNSGAIIBuilder
java.lang.Object
org.uma.evolver.algorithm.meta.MetaNSGAIIBuilder
Builder for creating NSGA-II instances configured for meta-optimization tasks with double
solutions. This builder provides sensible defaults for meta-optimization scenarios and internally
manages SBX crossover and polynomial mutation operators.
The builder follows the builder pattern for easy configuration of NSGA-II parameters and creates a fully configured NSGA-II instance ready for execution.
Example usage:
MetaNSGAIIBuilder builder = new MetaNSGAIIBuilder(problem)
.setPopulationSize(100)
.setMaxEvaluations(10000)
.setNumberOfCores(4);
EvolutionaryAlgorithm<DoubleSolution> nsgaii = builder.build();
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMetaNSGAIIBuilder(MetaOptimizationProblem<?> problem, ParameterSpace parameterSpace) Creates a new builder with the specified meta-optimization problem. -
Method Summary
Modifier and TypeMethodDescriptionorg.uma.jmetal.component.algorithm.EvolutionaryAlgorithm<org.uma.jmetal.solution.doublesolution.DoubleSolution> build()Builds and configures an NSGA-II instance with the specified parameters.setMaxEvaluations(int maxEvaluations) Sets the maximum number of evaluations for the NSGA-II algorithm.setMutationProbabilityFactor(double mutationProbabilityFactor) Sets the mutation probability factor for the NSGA-II algorithm.setNumberOfCores(int numberOfCores) Sets the number of cores to use for parallel evaluation.setOffspringPopulationSize(int offspringPopulationSize) Sets the offspring population size for the NSGA-II algorithm.setPopulationSize(int populationSize) Sets the population size for the NSGA-II algorithm.
-
Constructor Details
-
MetaNSGAIIBuilder
Creates a new builder with the specified meta-optimization problem.- Parameters:
problem- the meta-optimization problem to be solved (must not be null)- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if the problem is null
-
-
Method Details
-
setPopulationSize
Sets the population size for the NSGA-II algorithm.- Parameters:
populationSize- the population size (must be non-negative)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if populationSize is negative
-
setOffspringPopulationSize
Sets the offspring population size for the NSGA-II algorithm.- Parameters:
offspringPopulationSize- the offspring population size (must be positive)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if offspringPopulationSize is not positive
-
setMaxEvaluations
Sets the maximum number of evaluations for the NSGA-II algorithm.- Parameters:
maxEvaluations- the maximum number of evaluations (must be non-negative)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if maxEvaluations is negative
-
setNumberOfCores
Sets the number of cores to use for parallel evaluation.- Parameters:
numberOfCores- the number of CPU cores to use (must be non-negative)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if numberOfCores is negative
-
setMutationProbabilityFactor
Sets the mutation probability factor for the NSGA-II algorithm.- Parameters:
mutationProbabilityFactor- the mutation probability factor (must be non-negative)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if mutationProbabilityFactor is negative
-
build
public org.uma.jmetal.component.algorithm.EvolutionaryAlgorithm<org.uma.jmetal.solution.doublesolution.DoubleSolution> build()Builds and configures an NSGA-II instance with the specified parameters.The returned NSGA-II instance is configured with the following default operators:
- SBX Crossover (probability=0.9, distribution index=20.0)
- Polynomial Mutation (probability=1.0, distribution index=20.0)
- Tournament Selection (tournament size=2)
- Multi-threaded evaluation
- Returns:
- a fully configured NSGA-II instance ready for execution
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if the configuration is invalid
-