Park-and-ride lot choice and capacity - #1001
Conversation
Required to maintain backwards compatibility in tour indexes in SANDAG models
|
@copilot resolve the merge conflicts in this pull request |
jpn--
left a comment
There was a problem hiding this comment.
Mostly good. That several agencies have collaborated and tested this already gives some extra confidence. Only a couple minor bugs/concerns to address.
There was a problem hiding this comment.
Pull request overview
Implements explicit Park-and-Ride (PnR) lot choice and capacity-constrained iteration with tour mode choice, and extends skimming/logsum/matrix-writing infrastructure so PnR auto/transit legs can be modeled and reported without relying on expensive precomputed PnR skim sets.
Changes:
- Added a new
park_and_ride_lot_choicemodel plusParkAndRideCapacityhelper to iterate tour mode choice until PnR lots are within capacity. - Extended skim plumbing (
flow,logsums, tour scheduling logsums) to support origin→lot and lot→destination skims and optional inclusion of PnR in logsum computation. - Updated trip matrix writing to support table-specific origin/destination columns (enabling PnR leg matrix outputs) and added tests for both PnR iteration and matrix writing behavior.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| activitysim/core/util.py | Keeps pnr_lot_dest_col_name columns when dropping unused chooser columns. |
| activitysim/core/steps/output.py | Adjusts data dictionary text formatting width calculation. |
| activitysim/core/mp_tasks.py | Allocates shared multiprocessing buffers for PnR capacity iteration when configured. |
| activitysim/core/flow.py | Adds support for PnR lot destination column and additional PnR skim relationships. |
| activitysim/core/configuration/logit.py | Adds settings flags for at-work PnR and optional PnR inclusion in logsums. |
| activitysim/abm/test/test_misc/test_tour_mode_choice_simulate.py | New integration-style tests for tour mode choice with/without PnR iteration. |
| activitysim/abm/test/test_misc/test_park_and_ride_models.py | New unit tests for PnR lot choice filtering, utilities, and capacity synchronization logic. |
| activitysim/abm/tables/disaggregate_accessibility.py | Updates nearest accessibility zone helper signature to accept model settings. |
| activitysim/abm/models/util/vectorize_tour_scheduling.py | Integrates optional PnR lot choice into tour scheduling logsum computation and centralizes skim setup. |
| activitysim/abm/models/util/test/test_write_matrices.py | New tests validating matrix writing with custom OD columns for PnR legs. |
| activitysim/abm/models/util/school_escort_tours_trips.py | Tightens integer casting to explicit int64 dtype. |
| activitysim/abm/models/util/park_and_ride_capacity.py | New multiprocessing-aware PnR capacity accounting and chooser resampling logic. |
| activitysim/abm/models/util/logsums.py | Adds shared setup_skims helper and optional PnR lot choice during logsum creation. |
| activitysim/abm/models/trip_matrices.py | Supports per-table origin/destination columns and accumulating repeated table names into a single matrix. |
| activitysim/abm/models/tour_mode_choice.py | Adds iterative PnR capacity-constrained tour mode choice and reuses shared skim setup. |
| activitysim/abm/models/park_and_ride_lot_choice.py | New PnR lot choice model implementation and settings schema. |
| activitysim/abm/models/disaggregate_accessibility.py | Adds NEAREST_ZONE_SKIM configuration for nearest-zone selection behavior. |
| activitysim/abm/models/atwork_subtour_mode_choice.py | Adds optional at-work subtour PnR lot choice integration and shared skim setup. |
| activitysim/abm/models/init.py | Registers the new park_and_ride_lot_choice model module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@jpn-- I have address all the comments and merged in the latest main code. I think this should be ready to merge (assuming all the tests pass as expected) |
Code changes for #965