matsim-org / matsim-code-examples

A repository containing code examples around MATSim
GNU General Public License v3.0
81 stars 178 forks source link

Getting error after increasing the iteration number from 1 #296

Open zahraeftekhar opened 4 years ago

zahraeftekhar commented 4 years ago

Hello,

I am trying to run my code for more than 1 iteration but when I increase the iteration number I get an error that I do not know how to handle. My logfile WarningErrors is as follows :

2020-02-26 11:43:39,451 WARN QueueWithBuffer:378 Link 153408256_0 too small: enlarge storage capacity from: 0.029166666666666664 Vehicles to: 0.1720819216159375 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,451 WARN QueueWithBuffer:378 Link 153408256_0_r too small: enlarge storage capacity from: 0.029166666666666664 Vehicles to: 0.1720819216159375 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,455 WARN QueueWithBuffer:378 Link 245321592_0 too small: enlarge storage capacity from: 0.029166666666666664 Vehicles to: 0.5690750702769795 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,458 WARN QueueWithBuffer:378 Link 245321592_0_r too small: enlarge storage capacity from: 0.029166666666666664 Vehicles to: 0.5690750702769795 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,459 WARN QueueWithBuffer:378 Link 27344396_0 too small: enlarge storage capacity from: 0.05833333333333333 Vehicles to: 0.10381252696570335 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,460 WARN QueueWithBuffer:378 Link 27344396_0_r too small: enlarge storage capacity from: 0.05833333333333333 Vehicles to: 0.10381252696570335 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,461 WARN QueueWithBuffer:378 Link 326594039_0 too small: enlarge storage capacity from: 0.05833333333333333 Vehicles to: 0.07990747536699691 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,462 WARN QueueWithBuffer:378 Link 326594039_0_r too small: enlarge storage capacity from: 0.05833333333333333 Vehicles to: 0.07990747536699691 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,462 WARN QueueWithBuffer:378 Link 334164679_0 too small: enlarge storage capacity from: 0.05833333333333333 Vehicles to: 0.3552470087918055 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,462 WARN QueueWithBuffer:378 Link 334164679_0_r too small: enlarge storage capacity from: 0.05833333333333333 Vehicles to: 0.3552470087918055 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,463 WARN QueueWithBuffer:378 Link 334603581_0 too small: enlarge storage capacity from: 0.05833333333333333 Vehicles to: 0.29856986941473357 Vehicles. This is not fatal, but modifies the traffic flow dynamics. 2020-02-26 11:43:39,463 WARN QueueWithBuffer:381 Additional warnings of this type are suppressed. 2020-02-26 11:43:44,416 ERROR BasicPlanAgentImpl:159 last activity of person driver agent id 5463 has end time < infty; setting it to infty 2020-02-26 11:43:44,417 ERROR BasicPlanAgentImpl:160 This message given only once. 2020-02-26 11:45:56,929 WARN CharyparNagelActivityScoring:252 The first and the last activity do not have the same type. 2020-02-26 11:45:56,929 WARN CharyparNagelActivityScoring:253 Will score the first activity from midnight to its end, and the last activity from its start to midnight. 2020-02-26 11:45:56,930 WARN CharyparNagelActivityScoring:254 Because of the nonlinear function, this is not the same as scoring from start to end. 2020-02-26 11:45:56,930 WARN CharyparNagelActivityScoring:255 first activity: [type=sozializing][coord=null][linkId=144972031_0][startTime=undefined][endTime=19:18:01][duration=undefined][facilityId=null] 2020-02-26 11:45:56,930 WARN CharyparNagelActivityScoring:256 last activity: [type=home][coord=null][linkId=7382043_0][startTime=19:34:44][endTime=undefined][duration=undefined][facilityId=null] 2020-02-26 11:45:56,930 WARN CharyparNagelActivityScoring:257 This may also happen when plans are not completed when the simulation ends. 2020-02-26 11:45:56,930 WARN CharyparNagelActivityScoring:259 Additional warnings of this type are suppressed. 2020-02-26 11:46:11,293 WARN AStarEuclidean:171 finding totalCost=0.0; this will often (or always?) lead to a null pointer exception later. In my own case, it was related to a network having freespeed infinity at places. kai, jan'18 2020-02-26 11:46:11,295 ERROR AbstractMultithreadedModule$ExceptionHandler:210 Thread PlanRouter.0 died with exception. Will stop after all threads finished. java.lang.NullPointerException at org.matsim.core.router.AStarEuclidean.addToPendingNodes(AStarEuclidean.java:176) at org.matsim.core.router.Dijkstra.relaxNodeLogic(Dijkstra.java:423) at org.matsim.core.router.Dijkstra.relaxNode(Dijkstra.java:394) at org.matsim.core.router.AStarLandmarks.relaxNode(AStarLandmarks.java:138) at org.matsim.core.router.Dijkstra.searchLogic(Dijkstra.java:318) at org.matsim.core.router.Dijkstra.calcLeastCostPath(Dijkstra.java:237) at org.matsim.core.router.AStarLandmarks.calcLeastCostPath(AStarLandmarks.java:125) at org.matsim.core.router.NetworkRoutingModule.calcRoute(NetworkRoutingModule.java:95) at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:222) at org.matsim.core.router.PlanRouter.run(PlanRouter.java:90) at org.matsim.core.replanning.modules.AbstractMultithreadedModule$PlanAlgoThread.run(AbstractMultithreadedModule.java:234) at java.base/java.lang.Thread.run(Thread.java:835) 2020-02-26 11:46:18,728 WARN AStarEuclidean:171 finding totalCost=0.0; this will often (or always?) lead to a null pointer exception later. In my own case, it was related to a network having freespeed infinity at places. kai, jan'18 2020-02-26 11:46:18,728 ERROR AbstractMultithreadedModule$ExceptionHandler:210 Thread PlanRouter.4 died with exception. Will stop after all threads finished. java.lang.NullPointerException 2020-02-26 11:46:20,026 WARN AStarEuclidean:171 finding totalCost=0.0; this will often (or always?) lead to a null pointer exception later. In my own case, it was related to a network having freespeed infinity at places. kai, jan'18 2020-02-26 11:46:20,026 ERROR AbstractMultithreadedModule$ExceptionHandler:210 Thread PlanRouter.3 died with exception. Will stop after all threads finished. java.lang.NullPointerException 2020-02-26 11:46:24,157 WARN AStarEuclidean:171 finding totalCost=0.0; this will often (or always?) lead to a null pointer exception later. In my own case, it was related to a network having freespeed infinity at places. kai, jan'18 2020-02-26 11:46:24,158 ERROR AbstractMultithreadedModule$ExceptionHandler:210 Thread PlanRouter.1 died with exception. Will stop after all threads finished. java.lang.NullPointerException 2020-02-26 11:46:34,801 ERROR MatsimRuntimeModifications:54 Getting uncaught Exception in Thread main java.lang.RuntimeException: Some threads crashed, thus not all plans may have been handled. at org.matsim.core.replanning.modules.AbstractMultithreadedModule.finishReplanning(AbstractMultithreadedModule.java:159) at org.matsim.core.replanning.GenericPlanStrategyImpl.finish(GenericPlanStrategyImpl.java:114) at org.matsim.core.replanning.GenericStrategyManager.run(GenericStrategyManager.java:221) at org.matsim.core.replanning.StrategyManager.run(StrategyManager.java:191) at org.matsim.core.replanning.StrategyManager.run(StrategyManager.java:173) at org.matsim.core.controler.corelisteners.PlansReplanningImpl.notifyReplanning(PlansReplanningImpl.java:58) at org.matsim.core.controler.ControlerListenerManagerImpl.fireControlerReplanningEvent(ControlerListenerManagerImpl.java:206) at org.matsim.core.controler.AbstractController$3.run(AbstractController.java:139) at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:229) at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:136) at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:112) at org.matsim.core.controler.AbstractController.access$100(AbstractController.java:28) at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:80) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:48) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31) at org.matsim.core.controler.AbstractController.run(AbstractController.java:88) at org.matsim.core.controler.NewControler.run(NewControler.java:84) at org.matsim.core.controler.Controler.run(Controler.java:240) at org.matsim.codeexamples.run.RunMatsim_AMS.main(RunMatsim_AMS.java:40) Caused by: java.lang.NullPointerException 2020-02-26 11:46:34,802 ERROR MatsimRuntimeModifications:60 ERROR --- This is an unexpected shutdown! 2020-02-26 11:46:34,802 ERROR MatsimRuntimeModifications:63 Shutdown possibly caused by the following Exception: java.lang.RuntimeException: Some threads crashed, thus not all plans may have been handled. at org.matsim.core.replanning.modules.AbstractMultithreadedModule.finishReplanning(AbstractMultithreadedModule.java:159) at org.matsim.core.replanning.GenericPlanStrategyImpl.finish(GenericPlanStrategyImpl.java:114) at org.matsim.core.replanning.GenericStrategyManager.run(GenericStrategyManager.java:221) at org.matsim.core.replanning.StrategyManager.run(StrategyManager.java:191) at org.matsim.core.replanning.StrategyManager.run(StrategyManager.java:173) at org.matsim.core.controler.corelisteners.PlansReplanningImpl.notifyReplanning(PlansReplanningImpl.java:58) at org.matsim.core.controler.ControlerListenerManagerImpl.fireControlerReplanningEvent(ControlerListenerManagerImpl.java:206) at org.matsim.core.controler.AbstractController$3.run(AbstractController.java:139) at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:229) at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:136) at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:112) at org.matsim.core.controler.AbstractController.access$100(AbstractController.java:28) at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:80) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:48) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31) at org.matsim.core.controler.AbstractController.run(AbstractController.java:88) at org.matsim.core.controler.NewControler.run(NewControler.java:84) at org.matsim.core.controler.Controler.run(Controler.java:240) at org.matsim.codeexamples.run.RunMatsim_AMS.main(RunMatsim_AMS.java:40) Caused by: java.lang.NullPointerException 2020-02-26 11:46:34,803 ERROR MatsimRuntimeModifications:78 ERROR --- MATSim unexpectedly terminated. Please check the output or the logfile with warnings and errors for hints. 2020-02-26 11:46:34,803 ERROR MatsimRuntimeModifications:79 ERROR --- results should not be used for further analysis. 2020-02-26 11:46:34,803 ERROR MatsimRuntimeModifications:83 ERROR --- This was an unexpected shutdown! See the log file for a possible reason.

kainagel commented 4 years ago

The important part of the message is

WARN AStarEuclidean:171 finding totalCost=0.0; this will often (or always?) lead to a null pointer exception later. In my own case, it was related to a network having freespeed infinity at places. kai, jan'18

You need to find the cause of this. One option would be to have a debugger breakpoint at line 171 in AStarEuclidean.java; this works even when you are using the matsim-example-project and connecting to matsim via maven.