public void stepDecided(StepScope stepScope) {
}
public void stepTaken(StepScope stepScope) {
LocalSearchSolverScope localSearchSolverScope = stepScope.getLocalSearchSolverScope();
Score newScore = stepScope.getScore();
Score bestScore = localSearchSolverScope.getBestScore();
if (newScore.compareTo(bestScore) > 0) {
logger.info("New score ({}) is better then last best score ({}). Updating best solution and best score.",
newScore, bestScore);
localSearchSolverScope.setBestSolutionStepIndex(stepScope.getStepIndex());
Solution newBestSolution = stepScope.createOrGetClonedSolution();
localSearchSolverScope.setBestSolution(newBestSolution);
localSearchSolverScope.setBestScore(newBestSolution.getScore());
solverEventSupport.fireBestSolutionChanged(newBestSolution);
} else {
logger.info("New score ({}) is not better then last best score ({}).", newScore, bestScore);
}
}