@ Override public boolean isTabu ( Move < ? super SolutionType > move , SolutionType currentSolution ) { // apply move move . apply ( currentSolution ) ; // check: contained in tabu memory? boolean tabu = memory . contains ( currentSolution ) ; // undo move move . undo ( currentSolution ) ; // return result return tabu ; }
Verifies whether the given move is tabu by applying it to the current solution and checking if the obtained neighbour is currently contained in the tabu memory . If not the move is allowed . Before returning the move is undone to restore the original state of the current solution .