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

OptaWeb Vehicle Routing: NPE when adding location

XMLWordPrintable

    • 2018 Week 48-50, 2019 Week 02-04, 2018 Week 51-01
    • 2
    • NEW
    • NEW

      When adding my 106th location I got the NPE below.

      I believe it's because I clicked in the middle of a farmland or lake or something and it was too far from a road to give a connection to the rest of the road network.

      In Belgium, that's pretty difficult to do, but in the US, that's far more easy, because their population per km² is about 300 times less, so so are their road network density. Think grand canyon, nevada desert, Montana ,...

      org.kie.api.runtime.rule.ConsequenceException: Exception executing consequence for rule "distanceToPreviousStandstill" in org.optaplanner.examples.tsp.solver: java.lang.NullPointerException
              at org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
              at org.drools.core.common.DefaultAgenda.handleException(DefaultAgenda.java:1247)
              at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:438)
              at org.drools.core.phreak.RuleExecutor.fireActivation(RuleExecutor.java:379)
              at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:135)
              at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:88)
              at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34)
              at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
              at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1067)
              at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1014)
              at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1006)
              at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1337)
              at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1328)
              at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1312)
              at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.calculateScore(DroolsScoreDirector.java:117)
              at org.optaplanner.core.impl.score.director.AbstractScoreDirector.doAndProcessMove(AbstractScoreDirector.java:187)
              at org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider.doMove(LocalSearchDecider.java:132)
              at org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider.decideNextStep(LocalSearchDecider.java:116)
              at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.solve(DefaultLocalSearchPhase.java:70)
              at org.optaplanner.core.impl.solver.AbstractSolver.runPhases(AbstractSolver.java:87)
              at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:191)
              at org.optaweb.tsp.optawebtspplanner.TspPlannerComponent.lambda$addPlace$2(TspPlannerComponent.java:192)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              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)
      Caused by: java.lang.NullPointerException: null
              at org.optaplanner.examples.tsp.domain.location.RoadLocation.getDistanceTo(RoadLocation.java:54)
              at org.optaplanner.examples.tsp.domain.Visit.getDistanceFrom(Visit.java:76)
              at org.optaplanner.examples.tsp.domain.Visit.getDistanceFromPreviousStandstill(Visit.java:68)
              at org.drools.base.org.optaplanner.examples.tsp.domain.Visit442639079$getDistanceFromPreviousStandstill.getLongValue(Unknown Source)
              at org.drools.core.base.ClassFieldReader.getLongValue(ClassFieldReader.java:198)
              at org.drools.core.rule.Declaration.getLongValue(Declaration.java:247)
              at org.optaplanner.examples.tsp.solver.Rule_distanceToPreviousStandstill1733730232DefaultConsequenceInvokerGenerated.evaluate(Unknown Source)
              at org.optaplanner.examples.tsp.solver.Rule_distanceToPreviousStandstill1733730232DefaultConsequenceInvoker.evaluate(Unknown Source)
              at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:431)
              ... 24 common frames omitted
      
      

              jlocker Jiří Locker (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: