SolverBenchmarkResult result = solverBenchmarkResultList.get(resultIndex);
TerminationConfig originalTerminationConfig = solverBenchmark.getSolverConfig().getTerminationConfig();
TerminationConfig tmpTerminationConfig = originalTerminationConfig.clone();
tmpTerminationConfig.shortenMaximumTimeMillisSpendTotal(timeLeft);
solverBenchmark.getSolverConfig().setTerminationConfig(tmpTerminationConfig);
Solver solver = solverBenchmark.getSolverConfig().buildSolver();
File unsolvedSolutionFile = result.getUnsolvedSolutionFile();
Solution unsolvedSolution = readUnsolvedSolution(xStream, unsolvedSolutionFile);
solver.setPlanningProblem(unsolvedSolution);
solver.solve();
solverBenchmark.getSolverConfig().setTerminationConfig(originalTerminationConfig);
long timeSpend = System.currentTimeMillis() - startingTimeMillis;
timeLeft = warmUpTimeMillisSpendTotal - timeSpend;
}
logger.info("================================================================================");
logger.info("Finished warmUp");
logger.info("================================================================================");
}
for (SolverBenchmark solverBenchmark : solverBenchmarkList) {
for (SolverBenchmarkResult result : solverBenchmark.getSolverBenchmarkResultList()) {
// Intentionally create a fresh solver for every result to reset Random, tabu lists, ...
Solver solver = solverBenchmark.getSolverConfig().buildSolver();
File unsolvedSolutionFile = result.getUnsolvedSolutionFile();
Solution unsolvedSolution = readUnsolvedSolution(xStream, unsolvedSolutionFile);
solver.setPlanningProblem(unsolvedSolution);
List<SolverStatistic> statisticList = getOrCreateStatisticList(unsolvedSolutionFileToStatisticMap, unsolvedSolutionFile);
for (SolverStatistic statistic : statisticList) {
statistic.addListener(solver, solverBenchmark.getName());
}
solver.solve();
result.setTimeMillisSpend(solver.getTimeMillisSpend());
Solution solvedSolution = solver.getBestSolution();
result.setScore(solvedSolution.getScore());
for (SolverStatistic statistic : statisticList) {
statistic.removeListener(solver, solverBenchmark.getName());
}
writeSolvedSolution(xStream, solverBenchmark, result, solvedSolution);