Esempio n. 1
0
 private void writeBestScorePerTimeSpentSummaryChart() {
   // Each scoreLevel has it's own dataset and chartFile
   List<List<XYSeries>> seriesListList = new ArrayList<List<XYSeries>>(CHARTED_SCORE_LEVEL_SIZE);
   int solverBenchmarkIndex = 0;
   for (SolverBenchmarkResult solverBenchmarkResult :
       plannerBenchmarkResult.getSolverBenchmarkResultList()) {
     String solverLabel = solverBenchmarkResult.getNameWithFavoriteSuffix();
     for (SingleBenchmarkResult singleBenchmarkResult :
         solverBenchmarkResult.getSingleBenchmarkResultList()) {
       if (singleBenchmarkResult.hasAllSuccess()) {
         long timeMillisSpent = singleBenchmarkResult.getTimeMillisSpent();
         double[] levelValues =
             ScoreUtils.extractLevelDoubles(singleBenchmarkResult.getAverageScore());
         for (int i = 0; i < levelValues.length && i < CHARTED_SCORE_LEVEL_SIZE; i++) {
           if (i >= seriesListList.size()) {
             seriesListList.add(
                 new ArrayList<XYSeries>(
                     plannerBenchmarkResult.getSolverBenchmarkResultList().size()));
           }
           List<XYSeries> seriesList = seriesListList.get(i);
           while (solverBenchmarkIndex >= seriesList.size()) {
             seriesList.add(new XYSeries(solverLabel));
           }
           seriesList
               .get(solverBenchmarkIndex)
               .add((Long) timeMillisSpent, (Double) levelValues[i]);
         }
       }
     }
     solverBenchmarkIndex++;
   }
   bestScorePerTimeSpentSummaryChartFileList = new ArrayList<File>(seriesListList.size());
   int scoreLevelIndex = 0;
   for (List<XYSeries> seriesList : seriesListList) {
     XYPlot plot =
         createScalabilityPlot(
             seriesList,
             "Time spent",
             new MillisecondsSpentNumberFormat(locale),
             "Score level " + scoreLevelIndex,
             NumberFormat.getInstance(locale));
     JFreeChart chart =
         new JFreeChart(
             "Best score per time spent level "
                 + scoreLevelIndex
                 + " summary (higher left is better)",
             JFreeChart.DEFAULT_TITLE_FONT,
             plot,
             true);
     bestScorePerTimeSpentSummaryChartFileList.add(
         writeChartToImageFile(chart, "bestScorePerTimeSpentSummaryLevel" + scoreLevelIndex));
     scoreLevelIndex++;
   }
 }
Esempio n. 2
0
 private void writeBestScoreSummaryCharts() {
   // Each scoreLevel has it's own dataset and chartFile
   List<DefaultCategoryDataset> datasetList =
       new ArrayList<DefaultCategoryDataset>(CHARTED_SCORE_LEVEL_SIZE);
   for (SolverBenchmarkResult solverBenchmarkResult :
       plannerBenchmarkResult.getSolverBenchmarkResultList()) {
     String solverLabel = solverBenchmarkResult.getNameWithFavoriteSuffix();
     for (SingleBenchmarkResult singleBenchmarkResult :
         solverBenchmarkResult.getSingleBenchmarkResultList()) {
       String planningProblemLabel = singleBenchmarkResult.getProblemBenchmarkResult().getName();
       if (singleBenchmarkResult.hasAllSuccess()) {
         double[] levelValues =
             ScoreUtils.extractLevelDoubles(singleBenchmarkResult.getAverageScore());
         for (int i = 0; i < levelValues.length && i < CHARTED_SCORE_LEVEL_SIZE; i++) {
           if (i >= datasetList.size()) {
             datasetList.add(new DefaultCategoryDataset());
           }
           datasetList.get(i).addValue(levelValues[i], solverLabel, planningProblemLabel);
         }
       }
     }
   }
   bestScoreSummaryChartFileList = new ArrayList<File>(datasetList.size());
   int scoreLevelIndex = 0;
   for (DefaultCategoryDataset dataset : datasetList) {
     CategoryPlot plot =
         createBarChartPlot(
             dataset, "Score level " + scoreLevelIndex, NumberFormat.getInstance(locale));
     JFreeChart chart =
         new JFreeChart(
             "Best score level " + scoreLevelIndex + " summary (higher is better)",
             JFreeChart.DEFAULT_TITLE_FONT,
             plot,
             true);
     bestScoreSummaryChartFileList.add(
         writeChartToImageFile(chart, "bestScoreSummaryLevel" + scoreLevelIndex));
     scoreLevelIndex++;
   }
 }
Esempio n. 3
0
 private void determineDefaultShownScoreLevelIndex() {
   defaultShownScoreLevelIndex = Integer.MAX_VALUE;
   for (ProblemBenchmarkResult problemBenchmarkResult :
       plannerBenchmarkResult.getUnifiedProblemBenchmarkResultList()) {
     if (problemBenchmarkResult.hasAnySuccess()) {
       double[] winningScoreLevels =
           ScoreUtils.extractLevelDoubles(
               problemBenchmarkResult.getWinningSingleBenchmarkResult().getAverageScore());
       int[] differenceCount = new int[winningScoreLevels.length];
       for (int i = 0; i < differenceCount.length; i++) {
         differenceCount[i] = 0;
       }
       for (SingleBenchmarkResult singleBenchmarkResult :
           problemBenchmarkResult.getSingleBenchmarkResultList()) {
         if (singleBenchmarkResult.hasAllSuccess()) {
           double[] scoreLevels =
               ScoreUtils.extractLevelDoubles(singleBenchmarkResult.getAverageScore());
           for (int i = 0; i < scoreLevels.length; i++) {
             if (scoreLevels[i] != winningScoreLevels[i]) {
               differenceCount[i] = differenceCount[i] + 1;
             }
           }
         }
       }
       int firstInterestingLevel = differenceCount.length - 1;
       for (int i = 0; i < differenceCount.length; i++) {
         if (differenceCount[i] > 0) {
           firstInterestingLevel = i;
           break;
         }
       }
       if (defaultShownScoreLevelIndex > firstInterestingLevel) {
         defaultShownScoreLevelIndex = firstInterestingLevel;
       }
     }
   }
 }