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

A CHAINED model with only "null" anchors should throw a good error message

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 7.9.0.Final
    • None
    • optaplanner-core
    • None
    • NEW
    • NEW

      Not this, what it does currently:

      Caused by: java.lang.IllegalStateException: Local Search phase (1) needs to start from an initialized solution, but the planning variable (RockShow.previousStandstill) is uninitialized for the entity (Montgomery, Alabama).
      Maybe there is no Construction Heuristic configured before this phase to initialize the solution.
      Or maybe the getter/setters of your planning variables in your domain classes aren't implemented correctly.
      	at org.optaplanner.core.impl.phase.AbstractPhase.assertWorkingSolutionInitialized(AbstractPhase.java:220)
      	at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.phaseStarted(DefaultLocalSearchPhase.java:118)
      	at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.solve(DefaultLocalSearchPhase.java:64)
      	at org.optaplanner.core.impl.solver.AbstractSolver.runPhases(AbstractSolver.java:87)
      	at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:191)
      	at org.optaplanner.examples.common.business.SolutionBusiness.solve(SolutionBusiness.java:329)
      	at org.optaplanner.examples.common.swingui.SolverAndPersistenceFrame$SolveWorker.doInBackground(SolverAndPersistenceFrame.java:323)
      	at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at javax.swing.SwingWorker.run(SwingWorker.java:334)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      This happened because the anchor was null which got wrapped in an singletonList.

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

              Created:
              Updated:
              Resolved: