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 module specification #808

Open khzannat opened 2 years ago

khzannat commented 2 years ago

Hello, I am using DvrpModule and MultiModeDrtModule for Dhaka city. However, I am having an error:

2022-10-18T11:09:46,375 ERROR MatsimRuntimeModifications:75 Getting uncaught Exception in Thread main java.lang.NullPointerException: Cannot invoke "java.util.List.forEach(java.util.function.Consumer)" because "this.updatedVehSpecifications" is null at org.matsim.contrib.dvrp.fleet.VehicleStartLinkToLastLinkUpdater.notifyIterationEnds(VehicleStartLinkToLastLinkUpdater.java:71) ~[dvrp-13.0.jar:?] at org.matsim.core.controler.ControlerListenerManagerImpl.fireControlerIterationEndsEvent(ControlerListenerManagerImpl.java:168) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController$5.run(AbstractController.java:168) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:243) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:164) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:121) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:81) ~[matsim-13.0.jar:?] at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:69) [matsim-13.0.jar:?] at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:52) [matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.run(AbstractController.java:89) [matsim-13.0.jar:?] at org.matsim.core.controler.NewControler.run(NewControler.java:82) [matsim-13.0.jar:?] at org.matsim.core.controler.Controler.run(Controler.java:249) [matsim-13.0.jar:?] at org.matsim.project.RunMatsim11.run(RunMatsim11.java:240) [classes/:?] at org.matsim.project.RunMatsim11.main(RunMatsim11.java:35) [classes/:?] 2022-10-18T11:09:46,422 ERROR MatsimRuntimeModifications:81 ERROR --- This is an unexpected shutdown! 2022-10-18T11:09:46,422 ERROR MatsimRuntimeModifications:84 Shutdown possibly caused by the following Exception: java.lang.NullPointerException: Cannot invoke "java.util.List.forEach(java.util.function.Consumer)" because "this.updatedVehSpecifications" is null at org.matsim.contrib.dvrp.fleet.VehicleStartLinkToLastLinkUpdater.notifyIterationEnds(VehicleStartLinkToLastLinkUpdater.java:71) ~[dvrp-13.0.jar:?] at org.matsim.core.controler.ControlerListenerManagerImpl.fireControlerIterationEndsEvent(ControlerListenerManagerImpl.java:168) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController$5.run(AbstractController.java:168) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:243) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:164) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:121) ~[matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:81) ~[matsim-13.0.jar:?] at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:69) [matsim-13.0.jar:?] at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:52) [matsim-13.0.jar:?] at org.matsim.core.controler.AbstractController.run(AbstractController.java:89) [matsim-13.0.jar:?] at org.matsim.core.controler.NewControler.run(NewControler.java:82) [matsim-13.0.jar:?] at org.matsim.core.controler.Controler.run(Controler.java:249) [matsim-13.0.jar:?] at org.matsim.project.RunMatsim11.run(RunMatsim11.java:240) [classes/:?] at org.matsim.project.RunMatsim11.main(RunMatsim11.java:35) [classes/:?] Can anyone specify what is the reason to have this error? Code can be found here: https://github.com/khzannat/dhaka-matsim-example-project/blob/master/src/main/java/org/matsim/project/RunMatsim5.java

Janekdererste commented 2 years ago

When I check out your project, I can't find the place where the Exception is raised.

The Stack Trace you have posted here shows that your application was bound to matsim 13.0 (all those [matsim-13.0.jar:?] at the end of most lines). When I check out the project from the link matsim version 14.0 is bound, as it is specified in your pom.xml:

        <properties>
        <matsim.version>14.0</matsim.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

You can try to update your dependencies by either running mvn clean install -U, or if you want to do it from within IntelliJ right click on your pom.xml -> maven -> reload project. In your project panel you can make sure that the correct matsim version is bound by expanding External Libraries and then searching for org.matsim:matsim:14.0

khzannat commented 2 years ago

Thank you. I updated my version. Some of the parameters ModeRoutingParams and addModeRoutingParams are strike out. What were the new name of these parameters in new version. Also, in the new version after running 4 iteration, I got the error related to teleported event handler. What is it? logfileWarningsErrors.log