SolutionType
- solution type of the tabu memory, required to extend
Solution
; should match with the solution type
of the tabu search that uses this memorypublic interface TabuMemory<SolutionType extends Solution>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the tabu memory.
|
boolean |
isTabu(Move<? super SolutionType> move,
SolutionType currentSolution)
Indicates whether the given move is tabu, considering the current solution to which it will be applied
and the current state of the tabu memory.
|
void |
registerVisitedSolution(SolutionType visitedSolution,
Move<? super SolutionType> appliedMove)
Register a newly visited solution in the tabu memory.
|
boolean isTabu(Move<? super SolutionType> move, SolutionType currentSolution)
true
, the respective move
should not be considered by the search. If desired, the given move may be cast to a specific move type.
If this cast fails, an IncompatibleTabuMemoryException
should be thrown.
Note that if the specified current solution is modified by this method, it should be restored to its original state before returning.
move
- move that will be applied to the given current solutioncurrentSolution
- current solutiontrue
if the given move is tabu and should not be consideredIncompatibleTabuMemoryException
- in case of a mismatch in the given move typevoid registerVisitedSolution(SolutionType visitedSolution, Move<? super SolutionType> appliedMove)
IncompatibleTabuMemoryException
should be thrown.
Note that if the specified newly visited solution is modified by this method, it should be restored to its original state before returning.
visitedSolution
- newly visited solution (accepted new current solution)appliedMove
- move that has been applied to obtain the new solution, if any; can be null
otherwise, e.g. when updating the memory after setting a custom initial solutionIncompatibleTabuMemoryException
- in case of a mismatch in the given move typevoid clear()
Copyright © 2016. All rights reserved.