java.lang.Object
es.urjc.etsii.grafo.algorithms.cmsa.CMSABuilder<S,I,C>
- Type Parameters:
S- type of the solution of the problemI- type of the instance of the problemC- type of the solution components
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the CMSA algorithm with the configured parameters.Builds the CMSA algorithm with the configured parameters.CMSABuilder<S, I, C> withAgeMax(int ageMax) Configures the maximum age a solution component can reach, while not being used by the solver, before being removed from the sub-instance.CMSABuilder<S, I, C> withConstructive(CMSAConstructive<S, I, C> constructive) Configures the probabilistic constructive procedure used to sample solution components.CMSABuilder<S, I, C> Optimize default objective function, which is the main objective declared in the current Context.CMSABuilder<S, I, C> withMaxIterations(int maxIterations) Configures the maximum number of iterations.CMSABuilder<S, I, C> withObjective(Objective<?, S, I> objective) Configures the objective function to optimize.CMSABuilder<S, I, C> withSolutionsPerIteration(int solutionsPerIteration) Configures how many solutions are probabilistically constructed at each iteration before merging their components into the sub-instance and calling the solver.CMSABuilder<S, I, C> withSolver(CMSASolver<S, I, C> solver) Configures the exact (or near-exact) method used to solve the restricted sub-instance.CMSABuilder<S, I, C> withSolverTimeLimitInMillis(long solverTimeLimitInMillis) Configures the time budget, in milliseconds, given to the solver at each iteration to solve the restricted sub-instance.
-
Constructor Details
-
CMSABuilder
public CMSABuilder()
-
-
Method Details
-
withConstructive
Configures the probabilistic constructive procedure used to sample solution components.- Parameters:
constructive- probabilistic constructive procedure- Returns:
- this builder instance for method chaining
-
withSolver
Configures the exact (or near-exact) method used to solve the restricted sub-instance.- Parameters:
solver- exact method implementation- Returns:
- this builder instance for method chaining
-
withSolutionsPerIteration
Configures how many solutions are probabilistically constructed at each iteration before merging their components into the sub-instance and calling the solver. Defaults to 30.- Parameters:
solutionsPerIteration- number of solutions constructed at each iteration, usually denotedna- Returns:
- this builder instance for method chaining
-
withAgeMax
Configures the maximum age a solution component can reach, while not being used by the solver, before being removed from the sub-instance. Defaults to 5.- Parameters:
ageMax- maximum component age- Returns:
- this builder instance for method chaining
-
withSolverTimeLimitInMillis
Configures the time budget, in milliseconds, given to the solver at each iteration to solve the restricted sub-instance. Defaults to 1000 (1 second).- Parameters:
solverTimeLimitInMillis- time budget in milliseconds- Returns:
- this builder instance for method chaining
-
withMaxIterations
Configures the maximum number of iterations. Defaults to 0, disabling this limit and relying exclusively on the global time limit.- Parameters:
maxIterations- maximum number of iterations, use a value smaller or equal to zero to disable- Returns:
- this builder instance for method chaining
-
withDefaultObjective
Optimize default objective function, which is the main objective declared in the current Context. Note that calling this method is optional, if the objective is not set it will default to the main objective.- Returns:
- this builder instance for method chaining
-
withObjective
-
build
-
build
-