Package org.uma.evolver.algorithm.meta
Class MetaSMPSOBuilder
java.lang.Object
org.uma.evolver.algorithm.meta.MetaSMPSOBuilder
Builder for creating SMPSO (Speed-constrained Multi-objective Particle Swarm Optimization)
instances configured for meta-optimization tasks. This builder provides a convenient way to
configure and instantiate SMPSO with appropriate settings for meta-optimization scenarios.
Key features:
- Configurable swarm size and maximum evaluations
- Parallel evaluation support
- Sensible defaults for meta-optimization tasks
Example usage:
MetaSMPSOBuilder builder = new MetaSMPSOBuilder(metaOptimizationProblem)
.setSwarmSize(100)
.setMaxEvaluations(10000)
.setNumberOfCores(4);
ParticleSwarmOptimizationAlgorithm smpso = builder.build();
- Author:
- [Your Name]
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMetaSMPSOBuilder(MetaOptimizationProblem<?> problem) Creates a new builder with the specified meta-optimization problem. -
Method Summary
Modifier and TypeMethodDescriptionorg.uma.jmetal.component.algorithm.ParticleSwarmOptimizationAlgorithmbuild()Builds and configures an SMPSO instance with the specified parameters.setMaxEvaluations(int maxEvaluations) Sets the maximum number of evaluations for the SMPSO algorithm.setNumberOfCores(int numberOfCores) Sets the number of cores to use for parallel evaluation.setSwarmSize(int swarmSize) Sets the swarm size for the SMPSO algorithm.
-
Constructor Details
-
MetaSMPSOBuilder
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
-
setSwarmSize
Sets the swarm size for the SMPSO algorithm.- Parameters:
swarmSize- the number of particles in the swarm (must be positive)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if swarmSize is not positive
-
setMaxEvaluations
Sets the maximum number of evaluations for the SMPSO algorithm.- Parameters:
maxEvaluations- the maximum number of function evaluations (must be positive)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if maxEvaluations is not positive
-
setNumberOfCores
Sets the number of cores to use for parallel evaluation.- Parameters:
numberOfCores- the number of CPU cores to use (1 for sequential execution)- Returns:
- this builder instance for method chaining
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if numberOfCores is not positive
-
build
public org.uma.jmetal.component.algorithm.ParticleSwarmOptimizationAlgorithm build()Builds and configures an SMPSO instance with the specified parameters.The returned SMPSO instance is configured with:
- Default velocity constraint handling
- Multi-threaded evaluation
- Specified termination condition
- Configured swarm size
- Returns:
- a fully configured SMPSO instance ready for execution
- Throws:
org.uma.jmetal.util.errorchecking.JMetalException- if the problem is not a DoubleProblem or configuration is invalidClassCastException- if the problem cannot be cast to DoubleProblem
-