Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2382

Benchmarker does not use "Soft Score" for Constraint Stream API

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • 8.4.0.Final
    • optaplanner-benchmark
    • None
    • Hide
      1. Setup an opta benchmark with the configurations from the description and the constraints provided with the ConstraintStream API.
      2. Run the Benchmark with the Debug log level.

      IS: Only hard constraints are reported.

      SHOULD: Hard and soft constraints should be reported (as the normal, not benchmark, execution does).

      Show
      Setup an opta benchmark with the configurations from the description and the constraints provided with the ConstraintStream API. Run the Benchmark with the Debug log level. IS : Only hard constraints are reported. SHOULD : Hard and soft constraints should be reported (as the normal, not benchmark, execution does).
    • Undefined
    • NEW
    • NEW

    Description

      When benchmarking our application with the Opta benchmark, the soft score isn't reported. It seems like the soft score and the hard score get combined into one hard score value.

      Running the OptaPlanner normally, everything works fine and the score is reported correctly.

       

      Details regarding the application:

      Environment: SpringBoot+Gradle
      Constraint Definitions: Contraint Stream API

       

      Benchmark Config:

      <?xml version="1.0" encoding="UTF-8"?>
      <plannerBenchmark xmlns="https://www.optaplanner.org/xsd/benchmark"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation="https://www.optaplanner.org/xsd/benchmark https://www.optaplanner.org/xsd/benchmark/benchmark.xsd">
      
          <benchmarkDirectory>benchmark-data/results/exam-schedule</benchmarkDirectory>
          <warmUpSecondsSpentLimit>30</warmUpSecondsSpentLimit>
      
          <inheritedSolverBenchmark>
              <solver>
                  <moveThreadCount>AUTO</moveThreadCount>
                  <solutionClass>ch.ost.examscheduler.solvers.opta.domain.ExamTimetable</solutionClass>
                  <entityClass>ch.ost.examscheduler.solvers.opta.domain.Exam</entityClass>
                  <scoreDirectorFactory>
                      <constraintProviderClass>ch.ost.examscheduler.solvers.opta.solver.TimeTableConstraintProvider
                      </constraintProviderClass>
                      <initializingScoreTrend>ONLY_DOWN/ONLY_DOWN</initializingScoreTrend>
                  </scoreDirectorFactory>
                  <termination>
                      <unimprovedMinutesSpentLimit>30</unimprovedMinutesSpentLimit>
                  </termination>
              </solver>
              <problemBenchmarks>
                  <solutionFileIOClass>ch.ost.examscheduler.benchmark.ExamTimetableJsonSolutionFileIO</solutionFileIOClass>
                  <inputSolutionFile>benchmark-data/input/optaExamSchedulerBenchmarkTestSet-autogenerated.json
                  </inputSolutionFile>
              </problemBenchmarks>
              <subSingleCount>1</subSingleCount>
          </inheritedSolverBenchmark>
      
          <solverBenchmark>
              <solver>
                  <constructionHeuristic>
                      <constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
                  </constructionHeuristic>
                  <localSearch>
                      <acceptor>
                          <acceptorType>HILL_CLIMBING</acceptorType>
                      </acceptor>
                      <forager>
                          <acceptedCountLimit>1000</acceptedCountLimit>
                      </forager>
                  </localSearch>
              </solver>
          </solverBenchmark>
          <solverBenchmark>
              <solver>
                  <constructionHeuristic>
                      <constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
                  </constructionHeuristic>
                  <localSearch>
                      <acceptor>
                          <entityTabuRatio>0.02</entityTabuRatio>
                      </acceptor>
                      <forager>
                          <acceptedCountLimit>1000</acceptedCountLimit>
                      </forager>
                  </localSearch>
              </solver>
          </solverBenchmark>
      </plannerBenchmark>
      
      
      

       

      Planning Solution:

      @Getter
      @Setter
      @NoArgsConstructor
      @PlanningSolution
      public class ExamTimetable {
          @PlanningScore
          private HardSoftScore score;
      
          ...

       

       

      Attachments

        Activity

          People

            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            raphaeljenni Raphael Jenni (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: