@Override public void phaseEnded(LocalSearchSolverPhaseScope phaseScope) { super.phaseEnded(phaseScope); startingTemperatureLevels = null; temperatureLevels = null; levelsLength = -1; }
@Override public void stepEnded(LocalSearchStepScope stepScope) { super.stepEnded(stepScope); double timeGradient = stepScope.getTimeGradient(); double reverseTimeGradient = 1.0 - timeGradient; temperatureLevels = new double[levelsLength]; for (int i = 0; i < levelsLength; i++) { temperatureLevels[i] = startingTemperatureLevels[i] * reverseTimeGradient; if (temperatureLevels[i] < temperatureMinimum) { temperatureLevels[i] = temperatureMinimum; } } // TODO implement reheating }
@Override public void phaseStarted(LocalSearchSolverPhaseScope phaseScope) { super.phaseStarted(phaseScope); for (double startingTemperatureLevel : ScoreUtils.extractLevelDoubles(startingTemperature)) { if (startingTemperatureLevel < 0.0) { throw new IllegalArgumentException( "The startingTemperature (" + startingTemperature + ") cannot have negative level (" + startingTemperatureLevel + ")."); } } startingTemperatureLevels = ScoreUtils.extractLevelDoubles(startingTemperature); temperatureLevels = startingTemperatureLevels; levelsLength = startingTemperatureLevels.length; }