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

Exhaustive search by type BRANCH_AND_BOUND fails with score corruption in FULL_ASSERT mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.3.0.Beta1
    • 6.2.0.Final
    • None
    • None
    • Hide

      1. Download optaplanner with examples (version 6.2.0.Final)
      2. Start nQueens application with solver configuration (provided)
      Expected:
      Solving should complete succesfully
      Actual:
      Solving fails with score corruption

      Show
      1. Download optaplanner with examples (version 6.2.0.Final) 2. Start nQueens application with solver configuration (provided) Expected: Solving should complete succesfully Actual: Solving fails with score corruption

      NQueens application with 4 queens fails on solving the problem when exhaustiveSearch with type BRANCH_AND_BOUND is used. Logs report score corruption.
      2015-05-22 09:06:25,873 [AWT-EventQueue-0] INFO Opened: data/nqueens/unsolved/4queens.xml
      2015-05-22 09:06:27,275 [SwingWorker-pool-3-thread-1] INFO Solving started: time spent (10), best score (uninitialized/0), environment mode (FULL_ASSERT), random (JDK with seed 0).
      2015-05-22 09:06:27,309 [SwingWorker-pool-3-thread-1] DEBUG ES step (0), time spent (44), treeId (0-0), best score (uninitialized/0), selected move count (4).
      2015-05-22 09:06:27,331 [SwingWorker-pool-3-thread-1] DEBUG ES step (1), time spent (65), treeId (1-0), best score (uninitialized/0), selected move count (4).
      2015-05-22 09:06:27,340 [SwingWorker-pool-3-thread-1] DEBUG ES step (2), time spent (75), treeId (2-3), best score (uninitialized/0), selected move count (4).
      Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Solving failed.
      at org.optaplanner.examples.common.swingui.SolverAndPersistenceFrame$SolveWorker.done(SolverAndPersistenceFrame.java:297)
      at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
      at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
      at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
      at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
      at javax.swing.Timer.fireActionPerformed(Timer.java:312)
      at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
      at java.awt.EventQueue.access$300(EventQueue.java:103)
      at java.awt.EventQueue$3.run(EventQueue.java:706)
      at java.awt.EventQueue$3.run(EventQueue.java:704)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
      Caused by: java.lang.IllegalStateException: The moveClass (class org.optaplanner.core.impl.heuristic.selector.move.generic.ChangeMove)'s move (col0@null => row1) probably has a corrupted undoMove (col0@null => null). Or maybe there are corrupted score rules.
      Check the Move.createUndoMove(...) method of that Move class and enable EnvironmentMode FULL_ASSERT to fail-faster on corrupted score rules.
      Score corruption: the lastCompletedStepScore (0) is not the undoScore (-1).
      at org.optaplanner.core.impl.phase.scope.AbstractPhaseScope.assertExpectedUndoMoveScore(AbstractPhaseScope.java:140)
      at org.optaplanner.core.impl.exhaustivesearch.decider.ExhaustiveSearchDecider.doMove(ExhaustiveSearchDecider.java:145)
      at org.optaplanner.core.impl.exhaustivesearch.decider.ExhaustiveSearchDecider.expandNode(ExhaustiveSearchDecider.java:127)
      at org.optaplanner.core.impl.exhaustivesearch.DefaultExhaustiveSearchPhase.solve(DefaultExhaustiveSearchPhase.java:104)
      at org.optaplanner.core.impl.solver.DefaultSolver.runPhases(DefaultSolver.java:213)
      at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:176)
      at org.optaplanner.examples.common.business.SolutionBusiness.solve(SolutionBusiness.java:302)
      at org.optaplanner.examples.common.swingui.SolverAndPersistenceFrame$SolveWorker.doInBackground(SolverAndPersistenceFrame.java:286)
      at org.optaplanner.examples.common.swingui.SolverAndPersistenceFrame$SolveWorker.doInBackground(SolverAndPersistenceFrame.java:276)
      at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at javax.swing.SwingWorker.run(SwingWorker.java:335)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

      Solver configuration is attached

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

                Created:
                Updated:
                Resolved: