Package org.uma.evolver.algorithm.base
Class EvolutionaryAlgorithmBuilder<S extends org.uma.jmetal.solution.Solution<?>>
java.lang.Object
org.uma.evolver.algorithm.base.EvolutionaryAlgorithmBuilder<S>
- Type Parameters:
S- the type of solutions handled by the algorithm
public class EvolutionaryAlgorithmBuilder<S extends org.uma.jmetal.solution.Solution<?>>
extends Object
A builder class for creating instances of
EvolutionaryAlgorithm with optional archive support.
This builder provides a flexible way to configure and instantiate evolutionary algorithms,
with or without an external archive for storing non-dominated solutions.
Example usage:
EvolutionaryAlgorithm<DoubleSolution> algorithm = new EvolutionaryAlgorithmBuilder<DoubleSolution>()
.build(
"NSGA-II",
initialSolutionsCreation,
evaluation,
termination,
selection,
variation,
replacement,
archive // can be null if no archive is needed
);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.uma.jmetal.component.algorithm.EvolutionaryAlgorithm<S> build(String name, org.uma.jmetal.component.catalogue.common.solutionscreation.SolutionsCreation<S> initialSolutionsCreation, org.uma.jmetal.component.catalogue.common.evaluation.Evaluation<S> evaluation, org.uma.jmetal.component.catalogue.common.termination.Termination termination, org.uma.jmetal.component.catalogue.ea.selection.Selection<S> selection, org.uma.jmetal.component.catalogue.ea.variation.Variation<S> variation, org.uma.jmetal.component.catalogue.ea.replacement.Replacement<S> replacement, org.uma.jmetal.util.archive.Archive<S> archive) Builds an instance of EvolutionaryAlgorithm with the specified components.
-
Constructor Details
-
EvolutionaryAlgorithmBuilder
public EvolutionaryAlgorithmBuilder()
-
-
Method Details
-
build
public org.uma.jmetal.component.algorithm.EvolutionaryAlgorithm<S> build(String name, org.uma.jmetal.component.catalogue.common.solutionscreation.SolutionsCreation<S> initialSolutionsCreation, org.uma.jmetal.component.catalogue.common.evaluation.Evaluation<S> evaluation, org.uma.jmetal.component.catalogue.common.termination.Termination termination, org.uma.jmetal.component.catalogue.ea.selection.Selection<S> selection, org.uma.jmetal.component.catalogue.ea.variation.Variation<S> variation, org.uma.jmetal.component.catalogue.ea.replacement.Replacement<S> replacement, org.uma.jmetal.util.archive.Archive<S> archive) Builds an instance of EvolutionaryAlgorithm with the specified components.- Parameters:
name- the name of the algorithm (used for identification and logging)initialSolutionsCreation- component responsible for creating the initial populationevaluation- component that handles solution evaluationtermination- condition that determines when the algorithm should stopselection- operator for selecting parent solutionsvariation- operator for creating new solutions through recombination and mutationreplacement- strategy for updating the population with new solutionsarchive- optional archive for storing non-dominated solutions (can be null)- Returns:
- a configured instance of EvolutionaryAlgorithm
- Throws:
IllegalArgumentException- if any required parameter is null (except archive)
-