Skip to content

faq 284884996

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

Agents not loaded when using TrafficSignals

by Jimmy Joseph on 2018-06-02 11:24:15


Hello Everyone! I have currently been using MATSIM(0.9.x) to create my Thesis Project. What I have so far:

  • Downloaded a .OSM file and used JOSM to generate a network file(type - network_v1.dtd) by following the tutorial (Creating and editing networks using JOSM)

  • Generated shape files, and two facilities locations from the same .osm(using QGis(linux)) and followed the tutorial (Basic Demand Generation) to create population.xml (type - population_v6.dtd)

Running MATSIM worked as expected at this point(visualised using both Via and OFTVis)

Now, I would like to introduce some Traffic Lights into the network(just one to start off). I was following the tutorial.fixedTimeSignals in the signals package.

The given tutorial works fine. I changed the input to my network and node location to match my network. I also put in my population files(the example given uses a (type - plans_v4.dtd)) so I don't know if this a possible cause of the problem.

When trying to visualise I get the following error(red part of logs):

2018-06-02 11:59:40,227 ERROR QSim:314 got exception while cleaning up java.lang.NullPointerException at org.matsim.core.mobsim.qsim.qnetsimengine.QNetsimEngine.afterSim(QNetsimEngine.java:251) at org.matsim.core.mobsim.qsim.QSim.cleanupSim(QSim.java:311) at org.matsim.core.mobsim.qsim.QSim.run(QSim.java:243) at org.matsim.contrib.signals.otfvis.OTFVisWithSignals.playScenario(OTFVisWithSignals.java:88) at tutorial.fixedTimeSignals.JimVis.run(JimVis.java:43) at tutorial.fixedTimeSignals.JimVis.main(JimVis.java:47) Exception in thread "main" java.lang.RuntimeException: Object is null; follow stack trace at org.matsim.core.gbl.Gbl.assertNotNull(Gbl.java:203) at org.matsim.core.population.PopulationUtils.computeLinkIdFromActivity(PopulationUtils.java:429) at org.matsim.core.mobsim.qsim.agents.BasicPlanAgentImpl.<init>(BasicPlanAgentImpl.java:75) at org.matsim.core.mobsim.qsim.agents.PersonDriverAgentImpl.<init>(PersonDriverAgentImpl.java:55) at org.matsim.core.mobsim.qsim.agents.DefaultAgentFactory.createMobsimAgentFromPerson(DefaultAgentFactory.java:46) at org.matsim.core.mobsim.qsim.agents.DefaultAgentFactory.createMobsimAgentFromPerson(DefaultAgentFactory.java:1) at org.matsim.core.mobsim.qsim.agents.PopulationAgentSource.insertAgentsIntoMobsim(PopulationAgentSource.java:92) at org.matsim.core.mobsim.qsim.QSim.createAgents(QSim.java:271) at org.matsim.core.mobsim.qsim.QSim.prepareSim(QSim.java:256) at org.matsim.core.mobsim.qsim.QSim.run(QSim.java:220) at org.matsim.contrib.signals.otfvis.OTFVisWithSignals.playScenario(OTFVisWithSignals.java:88) at tutorial.fixedTimeSignals.JimVis.run(JimVis.java:43) at tutorial.fixedTimeSignals.JimVis.main(JimVis.java:47)

The OFTVis opens up with traffic lights on every node(i only specified 1 node) but I imagine dummy signals don't function unless i specify plans. There are no agents loaded. Although previously I could get the population files to work without the signals script.

Please point me in the right direction so I can solve this issue. Many Thanks for reading it through.


Comments: 3


Re: Agents not loaded when using TrafficSignals

by Theresa Thunig on 2018-06-04 14:42:57

Dear Jimmy,

this neither looks like a signals problem nor like an otfvis problem. The exception occurs because the simulation tries to access a link of an agents activity, but the link is null. How do you specify locations of activities in your population file? Does the simulation run without problems with the same network and population but without signals?

Can you please attach your network and population file? This would make it easier to find the problem.

Cheers,
Theresa


Re: Agents not loaded when using TrafficSignals

by Theresa Thunig on 2018-06-04 15:12:10

I found the problem: The tutorial starts the simulation without a controler (just by creating a qsim). At the time of MATSim version 9, this did not support running a simulation without a prepared population that already contains link IDs for their activities.

So, the solution is:
1. Either run the simulation with a controler (as e.g. in RunSignalSystemsExample) or
2. update to MATSim version 10 or
3. add link IDs to your population.

Let me know, if there are further problems.

Cheers,
Theresa


Re: Agents not loaded when using TrafficSignals

by Jimmy Joseph on 2018-06-11 10:01:15

Hi Theresa,

Apologies for the late response I had to be away for the last week. Thank you ever so much for looking through my problem. It seems like you are right, the link IDs were not created already.

I ran the simulation using the same files, but on the MATsim version 10 and everything worked out perfectly! :)

Thank You again, Jimmy

Clone this wiki locally