Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disaggregate Accessibility Sampling #835

Open
dhensle opened this issue Mar 19, 2024 · 1 comment
Open

Disaggregate Accessibility Sampling #835

dhensle opened this issue Mar 19, 2024 · 1 comment
Labels
Bug Something isn't working/bug f

Comments

@dhensle
Copy link
Contributor

dhensle commented Mar 19, 2024

Describe the bug
Disaggregate accessibility crashes due to no allowed MAZs.

This came up while SANDAG tried testing a new scenario with modified data. The crash happens here when we are attempting to sample candidate MAZs, and the reason the crash is happening is that the maz_candidate df is empty.

The process here is to first sample a TAZ and then pick an MAZ from it. Now the reason maz_candidate ends up being empty, despite the length check, appears to be the discrepancy between the taz_candidate df and the resulting taz_sample_idx, and the mazs that remain in the maz_candidates df after we filter it based on taz_sample_idx.

After we sample the maz indices, we remove those mazs from the maz_candiate df so we do not resample them. This process does not happen for the taz_candiate df (removing TAZs associated with those MAZs, which makes sense, since a TAZ might have multiple MAZ in it), but we end up with a case where we sample a TAZ at line 391 of the code (with the taz sample universe not reflecting the narrowing sample universe according to the mazs), and there is no MAZ remaining in the maz_candiate df associated with that TAZ, resulting in an empty maz_candidate df.

To Reproduce
Reproducibility is hard here -- need to get (un)lucky in the sampling.

Expected behavior
To fix, we can simply filter the taz_candiates so that it only contains TAZs associated with remaining maz_candidates. This way, we always make sure we have an MAZ list to sample from.

@dhensle dhensle added the Bug Something isn't working/bug f label Mar 19, 2024
@dhensle
Copy link
Contributor Author

dhensle commented Mar 19, 2024

Fix in the BayDAG work here solved the issue. PR #836 is the analogous commit back to ActivitySim main repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working/bug f
Projects
None yet
Development

No branches or pull requests

1 participant