matsim-org / matsim-libs

Multi-Agent Transport Simulation
www.matsim.org
489 stars 449 forks source link

Driver agent is null #2418

Open DACNC opened 1 year ago

DACNC commented 1 year ago

Hello,

I am running a MATSim simulation using QSim, SwissRailRaptor for PT and I am getting an error when enabling intermodalAccessEgress to pt modes by bike, car and walk. When intermodalAccessEgress is only allowed to walk and bike or walk and car there is not any error.

Please, find attached the config file used.

The error is the following: ERROR MatsimRuntimeModifications:76 Getting uncaught Exception in Thread main java.lang.NullPointerException: Cannot invoke "org.matsim.core.mobsim.framework.DriverAgent.getId()" because "this.driver" is null at org.matsim.core.mobsim.qsim.qnetsimengine.QVehicleImpl.toString(QVehicleImpl.java:187) ~[matsim-15.0-PR2396.jar:?] at java.lang.String.valueOf(String.java:4225) ~[?:?] at java.lang.StringBuilder.append(StringBuilder.java:173) ~[?:?] at com.google.common.base.MoreObjects$ToStringHelper.toString(MoreObjects.java:409) ~[guava-31.1-jre.jar:?] at org.matsim.core.mobsim.qsim.agents.BasicPlanAgentImpl.toString(BasicPlanAgentImpl.java:429) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.agents.TransitAgent.toString(TransitAgent.java:96) ~[matsim-15.0-PR2396.jar:?] at java.lang.StringConcatHelper.stringOf(StringConcatHelper.java:397) ~[?:?] at org.matsim.core.mobsim.qsim.qnetsimengine.VehicularDepartureHandler.handleCarDeparture(VehicularDepartureHandler.java:80) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.qnetsimengine.VehicularDepartureHandler.handleDeparture(VehicularDepartureHandler.java:57) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.QSim.arrangeAgentDeparture(QSim.java:510) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.QSim.arrangeNextAgentAction(QSim.java:464) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.QSim$1.arrangeNextAgentState(QSim.java:153) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.ActivityEngineDefaultImpl.doSimStep(ActivityEngineDefaultImpl.java:109) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.QSim.doSimStep(QSim.java:411) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.mobsim.qsim.QSim.run(QSim.java:259) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.NewControler.runMobSim(NewControler.java:125) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.AbstractController$8.run(AbstractController.java:212) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:244) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.AbstractController.mobsim(AbstractController.java:208) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:155) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:122) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:82) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:70) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:53) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.AbstractController.run(AbstractController.java:90) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.NewControler.run(NewControler.java:83) ~[matsim-15.0-PR2396.jar:?] at org.matsim.core.controler.Controler.run(Controler.java:250) ~[matsim-15.0-PR2396.jar:?] at org.matsim.project.RunMatsim.main(RunMatsim.java:132) ~[classes/:?]

Could you please help me with this? Thanks

config_qsim_PTmodes_v2.xml.gz

Janekdererste commented 1 year ago

This is hard to tell from the stack trace and the logfile. Could you provide a runnable example as git repository, then I can test this.

DACNC commented 1 year ago

Hi Janek,

Thank you. I have sent you an invite to my git repository. To run the simulation, use the RunMatsim.java class. The config file to use is the specified in that class (config_qsim_PTmodes_v2.xml).

Please, let me know if there is any issue when running it.