matsim-org / matsim-code-examples

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

DRT run problem #352

Open elyh1992 opened 4 years ago

elyh1992 commented 4 years ago

Hi, I'm trying to run a DRT scenario but I get this error. I also attached the run class so that may help in solving the problem. Thank you.

2020-06-05 01:58:35,840 ERROR AbstractMultithreadedModule$ExceptionHandler:210 Thread PlanRouter.0 died with exception. Will stop after all threads finished. java.lang.RuntimeException: Object is null; follow stack trace at org.matsim.core.gbl.Gbl.assertNotNull(Gbl.java:209) at org.matsim.core.router.NetworkRoutingInclAccessEgressModule.routeBushwhackingLeg(NetworkRoutingInclAccessEgressModule.java:250) at org.matsim.core.router.FallbackRoutingModuleDefaultImpl.calcRoute(FallbackRoutingModuleDefaultImpl.java:37) at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:208) at org.matsim.core.router.PlanRouter.run(PlanRouter.java:90) at org.matsim.core.replanning.modules.AbstractMultithreadedModule$PlanAlgoThread.run(AbstractMultithreadedModule.java:234) at java.lang.Thread.run(Thread.java:748) 2020-06-05 01:58:35,898 ERROR AbstractMultithreadedModule$ExceptionHandler:210 Thread PlanRouter.1 died with exception. Will stop after all threads finished. java.lang.RuntimeException: Object is null; follow stack trace at org.matsim.core.gbl.Gbl.assertNotNull(Gbl.java:209) at org.matsim.core.router.NetworkRoutingInclAccessEgressModule.routeBushwhackingLeg(NetworkRoutingInclAccessEgressModule.java:250) at org.matsim.core.router.FallbackRoutingModuleDefaultImpl.calcRoute(FallbackRoutingModuleDefaultImpl.java:37) at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:208) at org.matsim.core.router.PlanRouter.run(PlanRouter.java:90) at org.matsim.core.replanning.modules.AbstractMultithreadedModule$PlanAlgoThread.run(AbstractMultithreadedModule.java:234) at java.lang.Thread.run(Thread.java:748) 2020-06-05 01:58:35,899 ERROR MatsimRuntimeModifications:75 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:121) at org.matsim.core.replanning.GenericStrategyManager.run(GenericStrategyManager.java:222) 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:140) at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:230) at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:137) at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:113) at org.matsim.core.controler.AbstractController.access$100(AbstractController.java:29) at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:80) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:69) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:52) 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:247) at org.matsim.run.RunMelbourne_drt.run(RunMelbourne_drt.java:54) at org.matsim.run.RunMelbourne_drt.main(RunMelbourne_drt.java:75) Caused by: java.lang.RuntimeException: Object is null; follow stack trace at org.matsim.core.gbl.Gbl.assertNotNull(Gbl.java:209) at org.matsim.core.router.NetworkRoutingInclAccessEgressModule.routeBushwhackingLeg(NetworkRoutingInclAccessEgressModule.java:250) at org.matsim.core.router.FallbackRoutingModuleDefaultImpl.calcRoute(FallbackRoutingModuleDefaultImpl.java:37) at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:208) at org.matsim.core.router.PlanRouter.run(PlanRouter.java:90) at org.matsim.core.replanning.modules.AbstractMultithreadedModule$PlanAlgoThread.run(AbstractMultithreadedModule.java:234) at java.lang.Thread.run(Thread.java:748) 2020-06-05 01:58:35,900 ERROR MatsimRuntimeModifications:81 ERROR --- This is an unexpected shutdown! 2020-06-05 01:58:35,900 ERROR MatsimRuntimeModifications:84 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:121) at org.matsim.core.replanning.GenericStrategyManager.run(GenericStrategyManager.java:222) 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:140) at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:230) at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:137) at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:113) at org.matsim.core.controler.AbstractController.access$100(AbstractController.java:29) at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:80) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:69) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:52) 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:247) at org.matsim.run.RunMelbourne_drt.run(RunMelbourne_drt.java:54) at org.matsim.run.RunMelbourne_drt.main(RunMelbourne_drt.java:75) Caused by: java.lang.RuntimeException: Object is null; follow stack trace at org.matsim.core.gbl.Gbl.assertNotNull(Gbl.java:209) at org.matsim.core.router.NetworkRoutingInclAccessEgressModule.routeBushwhackingLeg(NetworkRoutingInclAccessEgressModule.java:250) at org.matsim.core.router.FallbackRoutingModuleDefaultImpl.calcRoute(FallbackRoutingModuleDefaultImpl.java:37) at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:208) at org.matsim.core.router.PlanRouter.run(PlanRouter.java:90) at org.matsim.core.replanning.modules.AbstractMultithreadedModule$PlanAlgoThread.run(AbstractMultithreadedModule.java:234) at java.lang.Thread.run(Thread.java:748) 2020-06-05 01:58:35,899 INFO AbstractMultithreadedModule:156 [PlanRouter] all 2 threads finished. 2020-06-05 01:58:35,900 INFO MatsimRuntimeModifications:79 S H U T D O W N --- start shutdown. 2020-06-05 01:58:35,900 INFO ControlerListenerManagerImpl:121 calling notifyShutdown on org.matsim.core.controler.corelisteners.EventsHandlingImpl 2020-06-05 01:58:35,900 INFO ControlerListenerManagerImpl:121 calling notifyShutdown on org.matsim.core.controler.corelisteners.DumpDataAtEndImpl 2020-06-05 01:58:35,901 INFO ControlerListenerManagerImpl:126 calling notifyShutdown on org.matsim.analysis.ModeStatsControlerListener 2020-06-05 01:58:35,901 INFO ControlerListenerManagerImpl:126 calling notifyShutdown on org.matsim.analysis.ScoreStatsControlerListener 2020-06-05 01:58:35,901 INFO ControlerListenerManagerImpl:126 calling notifyShutdown on org.matsim.analysis.TravelDistanceStatsControlerListener 2020-06-05 01:58:36,059 INFO ControlerListenerManagerImpl:126 calling notifyShutdown on org.matsim.contrib.drt.routing.DefaultDrtRouteUpdater 2020-06-05 01:58:36,059 INFO ControlerListenerManagerImpl:129 all ControlerShutdownListeners called. 2020-06-05 01:58:36,060 INFO MatsimRuntimeModifications:102 S H U T D O W N --- shutdown completed. 2020-06-05 01:58:36,059 ERROR MatsimRuntimeModifications:99 ERROR --- MATSim unexpectedly terminated. Please check the output or the logfile with warnings and errors for hints. 2020-06-05 01:58:36,060 ERROR MatsimRuntimeModifications:100 ERROR --- results should not be used for further analysis. 2020-06-05 01:58:36,060 ERROR MatsimRuntimeModifications:104 ERROR --- This was an unexpected shutdown! See the log file for a possible reason. 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:121) at org.matsim.core.replanning.GenericStrategyManager.run(GenericStrategyManager.java:222) 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:140) at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:230) at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:137) at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:113) at org.matsim.core.controler.AbstractController.access$100(AbstractController.java:29) at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:80) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:69) at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:52) 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:247) at org.matsim.run.RunMelbourne_drt.run(RunMelbourne_drt.java:54) at org.matsim.run.RunMelbourne_drt.main(RunMelbourne_drt.java:75) Caused by: java.lang.RuntimeException: Object is null; follow stack trace at org.matsim.core.gbl.Gbl.assertNotNull(Gbl.java:209) at org.matsim.core.router.NetworkRoutingInclAccessEgressModule.routeBushwhackingLeg(NetworkRoutingInclAccessEgressModule.java:250) at org.matsim.core.router.FallbackRoutingModuleDefaultImpl.calcRoute(FallbackRoutingModuleDefaultImpl.java:37) at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:208) at org.matsim.core.router.PlanRouter.run(PlanRouter.java:90) at org.matsim.core.replanning.modules.AbstractMultithreadedModule$PlanAlgoThread.run(AbstractMultithreadedModule.java:234) at java.lang.Thread.run(Thread.java:748)

Process finished with exit code 1

I think my config file and run class are correct. But here is the run class:

public class RunMelbourne_drt { private static final String drt_CONFIG = "scenarios/2017-11-scenario-by-kai-from-vista/config_drt.xml"; public static void run(Config config, boolean otfvis) {

    Controler controler = DrtControlerCreator.createControlerWithSingleModeDrt(config, otfvis);
    controler.addOverridingModule(new DrtFareModule());
    controler.run();
}

public static void main(String[] args) {

    Config config = ConfigUtils.loadConfig(drt_CONFIG, new MultiModeDrtConfigGroup(),
            new DvrpConfigGroup(),
            new OTFVisConfigGroup(), new DrtFaresConfigGroup());

    config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists);
    config.controler().setRoutingAlgorithmType( RoutingAlgorithmType.FastAStarLandmarks);
    config.qsim().setTrafficDynamics(TrafficDynamics.kinematicWaves);

    run(config, false);
}

}

michalmac commented 4 years ago

It could be that the input plans or config file are incorrect or do not match the matsim version you are running.

Currently, there is nothing special at line 250 NetworkRoutingInclAccessEgressModule.routeBushwhackingLeg(NetworkRoutingInclAccessEgressModule.java:250)), but half a year ago there was a check if ModeRoutingParams are null. These you can configure in the config.

whizkid-25 commented 4 years ago

Hi @michalmac ,

If I want to run the DRT scenario in GUI, is there are any available jar file that I can use?

tschlenther commented 4 years ago

Hi @michalmac ,

If I want to run the DRT scenario in GUI, is there are any available jar file that I can use?

Hi, try matsim-maas-drt-GUI.jar at https://github.com/matsim-org/matsim-maas and let us know if that works for you.

Best regards,

Tilmann