pam icon indicating copy to clipboard operation
pam copied to clipboard

Reading MATSim plans results in inflated leg and activity numbers

Open KasiaKoz opened this issue 4 years ago • 5 comments

Created input plans with the following stats:

{'num_households': 76530, 
'num_people': 76530, 
'num_activities': 313395, 
'num_legs': 236865}

Reading the output population after iteration 0 with MATSim gives

{'num_households': 76530,
 'num_people': 76530,
 'num_activities': 571585,
 'num_legs': 495055}

The following message shows up when reading both of them:

Negative duration activity found at pid=1000121102110
Cropping plan components

There are a few things here:

  1. I'm surprised that reading in plans that were created with pam have negative durations.
  2. What happens with activities with negative duration? Does it warrant doubling the number of activities/legs?
  3. I think this should be refined. The goal of pam, as I understand it, is to read plans, modify them and run these new plans as a scenario. I think having so many extra activities will result in unintended outcomes, every extra activity is extra demand so you're making a scenario but not the kind that you expect, your population may look very different once you load it in.

KasiaKoz avatar Nov 30 '20 10:11 KasiaKoz

First thought is that the additional activities are pt interactions.

The read_matsim function has a simplify_pt_trips arg (here). The default is false...

fredshone avatar Nov 30 '20 10:11 fredshone

Negative durations are a bummer. If it's not too inconvenient it would be great to get a xml sample of the negative duration plans so we can write some tests.

fredshone avatar Nov 30 '20 10:11 fredshone

you're right, the pt trips have a huge impact on the number of activities, I just read it in with simplify_pt_trips on

{'num_households': 76530,
 'num_people': 76530,
 'num_activities': 309625,
 'num_legs': 233095}

much closer to original

KasiaKoz avatar Nov 30 '20 10:11 KasiaKoz

that loss of activities will be pam cropping stuff after 24 hours...

fredshone avatar Nov 30 '20 10:11 fredshone

i am thinking to remove this restriction (or make it more optional) in future. Maybe pam can just generalise to activity plans of any duration, then we apply cropping more optionally.

fredshone avatar Nov 30 '20 10:11 fredshone