Skip to content

Park-and-ride lot choice and capacity - #1001

Open
dhensle wants to merge 56 commits into
ActivitySim:mainfrom
RSGInc:pnr_capacity
Open

Park-and-ride lot choice and capacity#1001
dhensle wants to merge 56 commits into
ActivitySim:mainfrom
RSGInc:pnr_capacity

Conversation

@dhensle

@dhensle dhensle commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Code changes for #965

@jpn--

jpn-- commented Jun 23, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

@jpn-- jpn-- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good. That several agencies have collaborated and tested this already gives some extra confidence. Only a couple minor bugs/concerns to address.

Comment thread activitysim/abm/models/util/park_and_ride_capacity.py
Comment thread activitysim/abm/models/util/park_and_ride_capacity.py
Comment thread activitysim/abm/models/util/park_and_ride_capacity.py
Comment thread activitysim/abm/models/util/park_and_ride_capacity.py Outdated
Comment thread activitysim/abm/models/util/park_and_ride_capacity.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_choice model plus ParkAndRideCapacity helper 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.

Comment thread activitysim/core/steps/output.py Outdated
Comment thread activitysim/abm/models/park_and_ride_lot_choice.py
Comment thread activitysim/abm/models/atwork_subtour_mode_choice.py Outdated
Comment thread activitysim/abm/models/util/park_and_ride_capacity.py Outdated
Comment thread activitysim/abm/tables/disaggregate_accessibility.py
Comment thread activitysim/abm/models/park_and_ride_lot_choice.py Outdated
Comment thread activitysim/abm/models/park_and_ride_lot_choice.py
@dhensle

dhensle commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants