}
protected PlannerBenchmarkFactory buildPlannerBenchmarkFactory(File unsolvedDataFile) {
String benchmarkConfigResource = createBenchmarkConfigResource();
PlannerBenchmarkFactory benchmarkFactory = PlannerBenchmarkFactory.createFromXmlResource(benchmarkConfigResource);
PlannerBenchmarkConfig plannerBenchmarkConfig = benchmarkFactory.getPlannerBenchmarkConfig();
String benchmarkDirectoryPath = plannerBenchmarkConfig.getBenchmarkDirectory().getPath();
// On Windows, getPath() contains backslashes instead of normal slashes
String prefix = "local" + File.separator + "data" + File.separator;
if (!benchmarkDirectoryPath.startsWith(prefix)) {
throw new IllegalStateException("The benchmarkDirectoryPath (" + benchmarkDirectoryPath
+ ") should start with prefix (" + prefix + ")");
}
plannerBenchmarkConfig.setBenchmarkDirectory(new File(benchmarkDirectoryPath.replace(prefix,
"target" + File.separator + "test" + File.separator + "data" + File.separator)));
plannerBenchmarkConfig.setWarmUpHoursSpentLimit(0L);
plannerBenchmarkConfig.setWarmUpMinutesSpentLimit(0L);
plannerBenchmarkConfig.setWarmUpSecondsSpentLimit(WARM_UP_SECONDS_SPENT);
plannerBenchmarkConfig.setWarmUpMillisecondsSpentLimit(0L);
List<SolverBenchmarkConfig> solverBenchmarkConfigList = plannerBenchmarkConfig.getSolverBenchmarkConfigList();
if (ConfigUtils.isEmptyCollection(solverBenchmarkConfigList)) {
throw new IllegalStateException("The benchmarkConfigResource (" + benchmarkConfigResource
+ ") should have at least 1 solverBenchmarkConfig.");
}
if (solverBenchmarkConfigList.size() > MAXIMUM_SOLVER_BENCHMARK_SIZE) {
solverBenchmarkConfigList = solverBenchmarkConfigList.subList(0, MAXIMUM_SOLVER_BENCHMARK_SIZE);
plannerBenchmarkConfig.setSolverBenchmarkConfigList(solverBenchmarkConfigList);
}
long maximumSecondsSpentPerSolverBenchmark = MAXIMUM_SECONDS_SPENT / solverBenchmarkConfigList.size();
SolverBenchmarkConfig inheritedSolverBenchmarkConfig = plannerBenchmarkConfig.getInheritedSolverBenchmarkConfig();
if (inheritedSolverBenchmarkConfig != null) {
ProblemBenchmarksConfig problemBenchmarksConfig = inheritedSolverBenchmarkConfig.getProblemBenchmarksConfig();
if (problemBenchmarksConfig == null) {
problemBenchmarksConfig = new ProblemBenchmarksConfig();
inheritedSolverBenchmarkConfig.setProblemBenchmarksConfig(problemBenchmarksConfig);