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

BestScoreFeasible termination throws NegativeArraySizeException with SimpleScore

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Optional
    • 8.28.0.Final
    • None
    • optaplanner-core
    • None
    • 2022 Week 35-37 (from Aug 29)
    • NEW
    • NEW

    Description

        <termination>
          <bestScoreFeasible>true</bestScoreFeasible>
        </termination>
      

      or

              .withTerminationConfig(new TerminationConfig().withBestScoreFeasible(true))
      

      throws

      java.lang.NegativeArraySizeException: -1
      	at org.optaplanner.core.impl.solver.termination.TerminationFactory.buildTermination(TerminationFactory.java:66)
      	at org.optaplanner.core.impl.solver.termination.TerminationFactory.buildTermination(TerminationFactory.java:31)
      	at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildSolver(DefaultSolverFactory.java:124)
      

      if used on a domain with SimpleScore or another score type that has zero feasible levels.

      Goal: avoid NegativeArraySizeException and throw an exception with a helpful message.

      Attachments

        Activity

          People

            jlocker Jiří Locker
            jlocker Jiří Locker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: