SolutionType
- solution type of the problems that may be solved using this search,
required to extend Solution
public abstract class MultiNeighbourhoodSearch<SolutionType extends Solution> extends NeighbourhoodSearch<SolutionType>
Constructor and Description |
---|
MultiNeighbourhoodSearch(Problem<SolutionType> problem,
List<? extends Neighbourhood<? super SolutionType>> neighs)
Create a new multi neighbourhood search, specifying the problem to be solved and the neighbourhoods used to
modify the current solution.
|
MultiNeighbourhoodSearch(String name,
Problem<SolutionType> problem,
List<? extends Neighbourhood<? super SolutionType>> neighs)
Create a new multi neighbourhood search, specifying the problem to be solved, the neighbourhoods used to
modify the current solution, and a custom search name.
|
Modifier and Type | Method and Description |
---|---|
List<? extends Neighbourhood<? super SolutionType>> |
getNeighbourhoods()
Get list of applied neighbourhoods (unmodifiable).
|
void |
setNeighbourhoods(List<? extends Neighbourhood<? super SolutionType>> neighs)
Sets the list of neighbourhoods used to modify the current solution.
|
accept, evaluate, getBestMove, getNumAcceptedMoves, getNumRejectedMoves, incNumAcceptedMoves, incNumRejectedMoves, init, isImprovement, reject, setEvaluatedMoveCache, updateCurrentSolution, validate
generateRandomInitialSolution, getCurrentSolution, getCurrentSolutionEvaluation, getCurrentSolutionValidation, setCurrentSolution, setCurrentSolution, updateCurrentAndBestSolution, updateCurrentAndBestSolution, updateCurrentSolution
addSearchListener, addStopCriterion, assertIdle, clearSearchListeners, clearStopCriteria, computeDelta, dispose, getBestSolution, getBestSolutionEvaluation, getBestSolutionValidation, getID, getMinDelta, getName, getProblem, getRandom, getRuntime, getSearchListeners, getStatus, getStatusLock, getSteps, getStepsWithoutImprovement, getTimeWithoutImprovement, removeSearchListener, removeStopCriterion, run, searchDisposed, searchStarted, searchStep, searchStopped, setRandom, setStopCriterionCheckPeriod, start, stop, toString, updateBestSolution, updateBestSolution
public MultiNeighbourhoodSearch(Problem<SolutionType> problem, List<? extends Neighbourhood<? super SolutionType>> neighs)
null
and the list of neighbourhoods
may not be empty and may not contain any null elements The default search name "MultiNeighbourhoodSearch"
is assigned.
The search stores an unmodifiable view of the given neighbourhood list.
problem
- problem to be solvedneighs
- neighbourhoods used to modify the current solutionNullPointerException
- if problem
or neighs
are null
, or if
neighs
contains a null
elementIllegalArgumentException
- if neighs
is emptypublic MultiNeighbourhoodSearch(String name, Problem<SolutionType> problem, List<? extends Neighbourhood<? super SolutionType>> neighs)
null
and the neighbourhood list may not be empty and may not contain any null
elements. The search name may be null
in which case the default name "MultiNeighbourhoodSearch"
is assigned.
The search stores an unmodifiable view of the given neighbourhood list.
name
- custom search nameproblem
- problem to be solvedneighs
- neighbourhoods used to modify the current solutionNullPointerException
- if problem
or neighs
are null
, or if
neighs
contains a null
elementIllegalArgumentException
- if neighs
is emptypublic List<? extends Neighbourhood<? super SolutionType>> getNeighbourhoods()
public void setNeighbourhoods(List<? extends Neighbourhood<? super SolutionType>> neighs)
neighs
can not be null
nor empty and can not contain any null
elements. This method
may only be called when the search is idle. It should be used with care for searches that have already
been run, as updating the neighbourhoods might break the execution of a restarted search that tries to
continue from where it had arrived.
An unmodifiable view of the given list is stored.
neighs
- list of neighbourhoods used to modify the current solutionNullPointerException
- if neighs
is null
or contains any null
elementsIllegalArgumentException
- if neighs
is emptySearchException
- if the search is currently not idleCopyright © 2016. All rights reserved.