Skip to content

ABM3 Intra-Household AV Allocation and Taxi/TNC Routing Models#366

Open
dhensle wants to merge 50 commits intomainfrom
ABM3_AV_TNC_routing
Open

ABM3 Intra-Household AV Allocation and Taxi/TNC Routing Models#366
dhensle wants to merge 50 commits intomainfrom
ABM3_AV_TNC_routing

Conversation

@dhensle
Copy link
Collaborator

@dhensle dhensle commented Oct 1, 2025

Draft PR of initial code implementation of both the intra-household AV allocation and taxi/TNC routing models.

Mode detailed description of code changes forthcoming.

Copy link
Contributor

@JiaXu1024 JiaXu1024 left a comment

Choose a reason for hiding this comment

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

The AV allocation model is not directly integrated with the main ActivitySim model pipeline. Could you update the config file to include it in the workflow?


class TaxiTNCSettings(BaseModel):
"""
Taxi / TNC route choice settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Lines 14–66 appear to duplicate the settings in taxi_tnc_routing_settings.yaml. Could you remove the redundant entries? I also noticed that single_tnc_modes doesn’t match the value in the YAML file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would like to keep the non-required settings here with their defaults. They generally need to be here for the pydantic model to validate the yaml file on read. I did update them to match the yaml file though -- thanks for catching that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to keep the non-required settings here with their defaults. They generally need to be here for the pydantic model to validate the yaml file on read. I did update them to match the yaml file though -- thanks for catching that.

Thanks for updating the single_tnc_modes setting. I also noticed the parameters of 'pair_batch_size', 'max_vehicle_occupancy', and 'max_wait_time' are not in the yaml file.

index=True,
)
pooled_trips.to_csv(
os.path.join(self.settings.output_dir, "output_tnc_pooled_trips.csv"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn’t notice the pooled trips output referenced in the TNC summaries. Is it already captured in output_tnc_vehicle_trips?

Copy link
Collaborator Author

@dhensle dhensle Jan 30, 2026

Choose a reason for hiding this comment

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

This output table is a useful table to evaluate the pooling algorithm output and debugging of the pooling algorithm. The output_tnc_vehicle_trips are the individual vehicle trips whereas this file specifically lists the trips that are pooled to eachother.

You have a suggestion for a more descriptive name I should use?

@JiaXu1024
Copy link
Contributor

Were the demand matrix files produced using the updated model as well? i.e. TNCVehicleTrips_[time_period].omx and emptyAVTrips.omx

@JiaXu1024 JiaXu1024 requested a review from Copilot January 30, 2026 23:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements two new routing models for ActivitySim's ABM3 demand modeling framework: an intra-household autonomous vehicle (AV) allocation model and a taxi/TNC fleet routing model. These models simulate vehicle dispatching and repositioning decisions for both household-owned AVs and for-hire vehicles.

Changes:

  • Adds AV routing model to allocate household AVs to driving trips and reposition vehicles between trips
  • Implements taxi/TNC routing model with trip pooling, vehicle dispatching, and refueling logic
  • Creates matrix builder utility to aggregate vehicle trips into OMX matrices for traffic assignment

Reviewed changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/asim/extensions/av_routing.py Core AV routing logic for matching household AVs to trips and repositioning decisions
src/asim/extensions/init.py Registers new av_routing extension module
src/asim/scripts/taxi_tnc_routing/taxi_tnc_routing.py Main taxi/TNC fleet simulation with pooling and dispatching
src/asim/scripts/taxi_tnc_routing/tnc_av_matrix_builder.py Utility to aggregate vehicle trips into OMX matrices by time period and occupancy
src/asim/scripts/taxi_tnc_routing/taxi_tnc_routing_settings.yaml Configuration file for taxi/TNC routing parameters
src/asim/scripts/taxi_tnc_routing/create_test_taxi_tnc_routing_scenario.py Test data generator for taxi/TNC routing model
src/asim/configs/resident/settings.yaml Adds av_routing model to pipeline and av_vehicle_trips to output tables
src/asim/configs/resident/settings_mp.yaml Adds av_routing to multiprocessing pipeline configuration
src/asim/configs/resident/av_routing.yaml Configuration for AV routing model specifications and coefficients
src/asim/configs/resident/av_trip_matching.csv Utility specification for AV trip matching model
src/asim/configs/resident/av_trip_matching_coefficients.csv Coefficients for AV trip matching utilities
src/asim/configs/resident/av_trip_matching_preprocessor.csv Preprocessor for AV trip matching variables
src/asim/configs/resident/av_repositioning.csv Utility specification for AV repositioning model
src/asim/configs/resident/av_repositioning_coefficients.csv Coefficients for AV repositioning utilities
src/asim/configs/resident/av_repositioning_preprocessor.csv Preprocessor for AV repositioning variables
src/asim/configs/resident/parking_location_choice_annotate_trips_preprocessor.csv Updates parking eligibility to exclude AV-serviced trips
src/asim/configs/common/constants.yaml Adds AV routing constants (max duration, parking cost)
docs/design/demand/av-routing.md Documentation for AV routing model design and configuration
docs/design/demand/taxi-tnc-routing.md Documentation for taxi/TNC routing model design and outputs
docs/design/demand/resident.md Updates resident model documentation to reference AV routing
mkdocs.yml Adds new documentation pages to navigation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dhensle dhensle marked this pull request as ready for review January 30, 2026 23:55
@dhensle
Copy link
Collaborator Author

dhensle commented Jan 30, 2026

Were the demand matrix files produced using the updated model as well? i.e. TNCVehicleTrips_[time_period].omx and emptyAVTrips.omx

Yes, these are being created by the tnc_av_matrix_builder.py file. (It was not yet committed when you made this comment, but is there now!)

@dhensle
Copy link
Collaborator Author

dhensle commented Jan 30, 2026

@JiaXu1024 I believe I have addressed all of the comments here. We are doing a final integration test and will of course fix any issues that arise from that, but I believe this is functionally complete!

@JiaXu1024 JiaXu1024 requested a review from aber-sandag February 3, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants