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

NPE when using Tabu

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate Issue
    • None
    • None
    • optaplanner-core
    • None

    Description

      Whenever I configure tabu search (be it solution, move or planning entity) in my acceptor, I get the following NPE:

      Exception in thread "main" java.lang.NullPointerException
      at org.drools.planner.core.localsearch.decider.acceptor.tabu.AbstractTabuAcceptor.stepTaken(AbstractTabuAcceptor.java:163)
      at org.drools.planner.core.localsearch.decider.acceptor.CompositeAcceptor.stepTaken(CompositeAcceptor.java:69)
      at org.drools.planner.core.localsearch.decider.DefaultDecider.stepTaken(DefaultDecider.java:166)
      at org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.stepTaken(DefaultLocalSearchSolverPhase.java:107)
      at org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.solve(DefaultLocalSearchSolverPhase.java:71)
      at org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:183)
      at org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:151)
      at org.drools.planner.examples.ras2012.App.main(App.java:25)

      Looking at the relevant place in code, we find:

      Integer oldTabuStepIndexInteger = tabuToStepIndexMap.get(oldTabu);
      int oldTabuStepCount = tabuStepIndex - oldTabuStepIndexInteger; // at least 1

      It appears that the code doesn't cover the case where tabuToStepIndexMap doesn't contain oldTabu.

      Should a reproducer be needed, please look at the following Github repo, configure the solver to use tabus, and launch the application via App.java:
      https://github.com/triceo/ras12

      Attachments

        Issue Links

          Activity

            People

              gdesmet@redhat.com Geoffrey De Smet
              lpetrovi@redhat.com Lukáš Petrovický
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: