Interface SingleSolutionMetaheuristic<T extends Copyable<T>>
- Type Parameters:
T- The type of object under optimization.
- All Superinterfaces:
- All Known Implementing Classes:
public interface SingleSolutionMetaheuristic<T extends Copyable<T>> extends ReoptimizableMetaheuristic<T>This interface defines the required methods for implementations of single-solution metaheuristics, i.e., metaheuristics such as simulated annealing that operate one a single candidate solution (as compared to population-based metaheuristics such as genetic algorithms. It is also specifically focused on metaheuristics for which the maximum run length can be specified.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
optimize(int runLength, T start)Executes a run of the metaheuristic beginning at a specified starting solution.
SolutionCostPair<T> optimize(int runLength, T start)
Executes a run of the metaheuristic beginning at a specified starting solution. If this method is called multiple times, each call begins by reinitializing the metaheuristic's control parameters. as if it was a fresh run.
Implementing classes should provide more specific documentation of this method to define in particular what run length means in the context of the given metaheuristic. It is also recommended that implementing classes rename the runLength parameter to be a more meaningful name within the context of that metaheuristic.
runLength- The length of a run of this metaheuristic.
start- The desired starting solution.
- The current solution at the end of this run and its cost, which may or may not be the best
of run solution, and which may or may not be the same as the solution contained
in this metaheuristic's
ProgressTracker, which contains the best of all runs. Returns null if the run did not execute, such as if the ProgressTracker already contains the theoretical best solution.