-
Notifications
You must be signed in to change notification settings - Fork 179
faq 253919251
inconclusive ERROR matsim.core.mobsim.qsim.qnetsimengine.QNetsimEngine.registerAdditionalAgentOnLink
by Gerald Richter on 2018-03-28 09:17:42
Help appreciated on how to resolve this problem.
When running simulations on
a random population subsample of 30 %
on a network that had some links intentionally removed (due to some assumed road-blocking events)
after taking care of possible references in the plans to links that are not present anymore
I get completely inconclusive error messages:
...
2018-03-28 10:38:15,701 INFO EventsManagerImpl:134 event # 16384
2018-03-28 10:38:15,795 INFO Gbl:187 Thread performance: Thread=class org.matsim.core.events.SimStepParallelEventsManagerImpl$ProcessEventsRunnable0 cpu-time=0.3588023sec
2018-03-28 10:38:15,796 ERROR AbstractController:203 Mobsim did not complete normally! afterMobsimListeners will be called anyway.
java.lang.NullPointerException
at org.matsim.core.mobsim.qsim.qnetsimengine.QNetsimEngine.registerAdditionalAgentOnLink(QNetsimEngine.java:396)
at org.matsim.core.mobsim.qsim.QSim$1.registerAdditionalAgentOnLink(QSim.java:154)
at org.matsim.core.mobsim.qsim.ActivityEngine.handleActivity(ActivityEngine.java:170)
at org.matsim.core.mobsim.qsim.QSim.arrangeAgentActivity(QSim.java:428)
at org.matsim.core.mobsim.qsim.QSim.arrangeNextAgentAction(QSim.java:406)
at org.matsim.core.mobsim.qsim.QSim.run(QSim.java:232)
...
please note that in these messages:
there is no reference to any agent id,
there is no reference to any network link or location
the same population runs fine in an undamaged network
the same population runs fine in several cases of a differently damaged network (i.e. other links removed)
the same network can be simulated fine with a different (also randomly drawn) 10 % sample of the total population.
I need a starting point to understand the problem,
preferably without doing debugs on compiler/IDE level.
thanks & regards
Re: inconclusive ERROR matsim.core.mobsim.qsim.qnetsimengine.QNetsimEngine.registerAdditionalAgentOnLink
by Davi Bicudo on 2018-03-28 14:30:04
"after taking care of possible references in the plans to links that are not present anymore"
You mean changing links in the legs' routes? If so, have you tried running with the original population, i.e. not yet routed? Otherwise, if you mean the link for the activities, have you tried replacing links for coordinates?
Re: inconclusive ERROR matsim.core.mobsim.qsim.qnetsimengine.QNetsimEngine.registerAdditionalAgentOnLink
by Jinkai Zhou on 2018-03-28 15:54:46
Try running the original population and network without removing the "links" in either file. It might be you removed some links too much.
Re: inconclusive ERROR matsim.core.mobsim.qsim.qnetsimengine.QNetsimEngine.registerAdditionalAgentOnLink
by Kai Nagel on 2018-04-21 19:31:40
Catching up on email after long travels. Not sure if this one here is still an issue. Some comments:
Often, there are additional error messages in the logfile before the "Mobsim did not complete normally!" statement. Did you check for those?
If you know your version of the code, you can go into the sources and check for more details. In this case, it seems that it tries to place an agent on a link with which it has problems. When you look into the code at
QNetsimEngine
, it looks likeplanAgent.getCurrentLinkId()
returned something, but thenqLink = network.getNetsimLink(linkId)
finds null so there is a null pointer exception when the code is trying to use qLink in the line that follows. This could happen if an agent has a linkId in the activity which does not exist in the network. You state that you removed such instances, so I don't know.I would expect that faulty links in routes lead to agent abortion. That leads to very low scores; eventually, the agent will be re-routed on the valid network; and then the faulty route will die out. Maybe this is what you mean with "leads to re-routing", but I would, as explained, expect it to function more indirectly than what you seem to imply.
I would support the above recommendation to remove links from activities and fall back on coordinates. Or, possibly, remove those links that are no longer there (which is, presumably, what you did). In the end, I have to say, it looks like you overlooked some case where the link was removed from the network but it is still in the plan. If you have network cleaning in between, the link may have been removed there.
Re missing agent id etc.: You might be able to run in a debugger.
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq