matsim-org / matsim-code-examples

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

How to check if the public transportation has reached the maximum capacity? #610

Open fayexin opened 3 years ago

fayexin commented 3 years ago

Dear Sir, I am using matsim to simulate a whole state area. The result looks good when I try a 100k sample; 500 people were stuck in the network and didn't get out. But when I try an 800k population file, about 60k people were stuck in the network and didn't get out. I'm not sure why the performance isn't consistent when I increase the population. I'm wondering the PT capacity may cause it. How could I check whether the simulation has reached the maximum capacity of public transportation?

balacmi commented 3 years ago

Hi @fayexin,

You should be able to see in the events file, which agents are still stuck (at the end of the file). You can also see if there is large congestion on your network by looking at the car leg histogram files. Usually, when you simulate only one iteration this can happen as the simulation is not in equilibrium and then you can have a lot of agents not finishing their daily plan. How you describe your problem this seems to be the issue.

In the future it would usually help to give us a bit more information on your simulation set-up to provide better and quicked answers.

mrieser commented 3 years ago

Via has a "stuck-agent analysis" that might give you more insights: https://docs.simunto.com/via/analyses/stuck-agents.html . After analyzing the event files, it shows when and where agents get stuck and with which mode they were traveling when they got stuck. It might help pinpoint if, and which, pt lines or stops are overcrowded.

fayexin commented 3 years ago

@balacmi @mrieser

Hi! Thanks for your help. After the discussion here, I tried the stuck-agent analysis tool of VIA. Here are some problems with my results. Most of the stuck problems are caused by PT.

image

I also tried three groups of population subsets, and each of them contains a 100k population. They should come from different parts of the area in the target region. However, the agents stuck in the simulation is vary from 500 to 1400. Is this case usual? When I increase the size of the population, the stuck problem gets worse.

It seems that some agents stuck in the network since the early morning. Is that indicate that there is no service around the home location of those agents? I created the network based on the OSM network and four local GTFS files by PT2Matsim. I also attached my config file.

smartCity.config_19n.txt

Is there any way I could visualize all the stuck and aborted links? Would it work if I modify the population file or the configuration file?

Thanks very much for your help!

balacmi commented 2 years ago

It is not clear to me why would this be happening. You could look at the plan of one agent that is stuck, and check which PT line is it trying to use when it is getting stuck. Sometimes it happens that the agent misses a connection, but there is no other connection on the same service line later in the day, so the agent becomes stuck. You can also check in the events file when the specific agent arrived at the pt stop.