matsim-org / matsim-code-examples

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

Solve the stuckAndAbort persons in the network #592

Open fayexin opened 3 years ago

fayexin commented 3 years ago

Dear sir,

I had asked one question before about what caused the simulation stuck in iteration 0 and would not enter into iteration 1 after I change the end time in the qsim module of the config file. I found the passengers who are type="stuckAndAbort" were waiting for Pt. It's too late, and no Pt service, so they waited forever. I also checked the previous events; most of them walks for a very long time before their last Pt trip.

event time="78328.0" type="waitingForPt" person="6556" agent="6556" atStop="36854.link:661694" destinationStop="29332.link:33573"
event time="129600.0" type="stuckAndAbort" person="6556" link="661694" legMode="pt"

I want to find a way to solve those "stuckAndAbort" and make them could leave the simulation to make it into the next iteration. If I don't change the current network, could I change the passenger's walking speed (change the default walking speed of the simulation) to make the passenger walk very fast?

Thanks a lot for the help!

kainagel commented 3 years ago

To some extent, this is just how it is: It can also happen in real life that you miss the last bus. Now in MATSim, because agents change times randomly, that happens more often than in real life. And because in MATSim agents normally do not replan while en-route, they will just stay there and wait for the bus that never arrives. And this is indeed technically not an "abort" condition, just "very stupid behavior".

I think that what most people do is to set a simulation end time. At which point these agents are aborted. (I think that is what you did as well.). Because they receive a low score for that plan, the plan will most of the time no longer be selected, etc. etc.

Overall, however, this is indeed not very nice. It would be somewhat better to repeat the public transport schedule for the next morning, so that they could at least take the first bus on the next day. This needs to be explicitly coded in the transit schedule, with times larger than 24:00:00. I don't think anybody is doing that, although it would certainly better than the solution with the simulation end time.

We have some loose plan that agents do within-day planning when they arrive at the pt stop. This would be a relatively clean solution: The would note that they missed the last bus, and then walk. However, we ain't there yet, and it is not even in the pipeline. :-(

Making agents walk faster will not solve the problem, since the router will also know that, and then let them depart from the previous activity even later.

Hopefully someone else can report experiences, I just report from 2nd hand.

vsp-gleich commented 3 years ago

Actually I have added methods to GTFS2Matsim which copy early departures (0:10) to the next day (24:10) and vice-versa (sometimes 0:10 departures are saved as 24:10 in gtfs). But we don't force users to run those after conversion. The number of hours to copy is not clear (for Berlin maybe 24:00-30:00 is sufficient, but for a country-wide model you might want 24:00-48:00).

fayexin commented 3 years ago

Actually I have added methods to GTFS2Matsim which copy early departures (0:10) to the next day (24:10) and vice-versa (sometimes 0:10 departures are saved as 24:10 in gtfs). But we don't force users to run those after conversion. The number of hours to copy is not clear (for Berlin maybe 24:00-30:00 is sufficient, but for a country-wide model you might want 24:00-48:00).

Hi, I am using GTFS2Matsim to generate the new schedule file which contain another 12 hours schedule. But previously I use PT2Matsim to generate a multi-modal network. Can I use this schedule to the network that I am working with? Thanks a lot!