79752892

Date: 2025-09-01 20:37:28
Score: 2
Natty:
Report link

I managed to find a solution for this. If someone knows a better solution, please let me know.

public File aggregateAllBenchmarks() {
// Load benchmark configuration
PlannerBenchmarkConfig benchmarkConfig = PlannerBenchmarkConfig.createFromXmlResource("benchmarkConfig.xml");
File benchmarkDirectory = new File(String.valueOf(benchmarkConfig.getBenchmarkDirectory()));
if (!benchmarkDirectory.exists() || !benchmarkDirectory.isDirectory()) {
    throw new IllegalArgumentException("Benchmark directory does not exist: " + benchmarkDirectory);
}

// Read all existing benchmark results from the directory
BenchmarkResultIO benchmarkResultIO = new BenchmarkResultIO();
List<PlannerBenchmarkResult> plannerBenchmarkResults = 
        benchmarkResultIO.readPlannerBenchmarkResultList(benchmarkDirectory);

if (plannerBenchmarkResults.isEmpty()) {
    throw new IllegalArgumentException("No benchmark results found in directory: " + benchmarkDirectory);
}

// Collect all single benchmark results and preserve solver names
List<SingleBenchmarkResult> allSingleBenchmarkResults = new ArrayList<>();
Map<SolverBenchmarkResult, String> solverBenchmarkResultNameMap = new HashMap<>();

for (PlannerBenchmarkResult plannerResult : plannerBenchmarkResults) {
    for (SolverBenchmarkResult solverResult : plannerResult.getSolverBenchmarkResultList()) {
        allSingleBenchmarkResults.addAll(solverResult.getSingleBenchmarkResultList());
        solverBenchmarkResultNameMap.put(solverResult, solverResult.getName());
    }
}

// Create and configure the benchmark aggregator
BenchmarkAggregator aggregator = new BenchmarkAggregator();
aggregator.setBenchmarkDirectory(benchmarkDirectory);
aggregator.setBenchmarkReportConfig(benchmarkConfig.getBenchmarkReportConfig());

// Perform the aggregation - returns HTML report file
File htmlOverviewFile = aggregator.aggregate(allSingleBenchmarkResults, solverBenchmarkResultNameMap);

return htmlOverviewFile;
}
Reasons:
  • RegEx Blacklisted phrase (2.5): please let me know
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Diallo Francis Patrick