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

UndoMove.toString() called after it happens causes confusing log message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • Future
    • 6.2.0.Final
    • optaplanner-core
    • NEW
    • NEW

      The message "corrupted undoMove (B1

      {B0 -> B0})" in the stacktrace below seems to indicate that the move is invalid as it moved from B0 to B0. But it didn't come from B0. Because the entity already changed, the from value is gone, replaced by the to value, so the Move.toString() is in accurate (as it needs to be called before the move is done).
      
      

      Caused by: java.lang.IllegalStateException: UndoMove corruption: the beforeMoveScore (0hard/0soft) is not the undoScore (-570hard/0soft) which is the uncorruptedScore (-570hard/0soft) of the workingSolution.
      1) Enable EnvironmentMode FULL_ASSERT (if you haven't already) to fail-faster in case there's a score corruption.
      2) Check the Move.createUndoMove(...) method of the moveClass (class org.optaplanner.core.impl.heuristic.selector.move.generic.chained.ChainedChangeMove). The move (B1 {B0 -> C1}) might have a corrupted undoMove (B1 {B0 -> B0}

      ).
      3) Check your custom VariableListeners (if you have any) for shadow variables that are used by the score constraints with a different score weight between the beforeMoveScore (0hard/0soft) and the undoScore (-570hard/0soft).
      at org.optaplanner.core.impl.phase.scope.AbstractPhaseScope.assertExpectedUndoMoveScore(AbstractPhaseScope.java:140)
      at org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider.doMove(LocalSearchDecider.java:153)
      at org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider.decideNextStep(LocalSearchDecider.java:121)
      at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.solve(DefaultLocalSearchPhase.java:72)
      at org.optaplanner.core.impl.solver.DefaultSolver.runPhases(DefaultSolver.java:214)
      at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:176)
      at org.optaplanner.examples.common.business.SolutionBusiness.solve(SolutionBusiness.java:324)

      
      

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

                Created:
                Updated: