Skip to content

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

Open
dhensle wants to merge 59 commits into
mainfrom
ABM3_AV_TNC_routing
Open

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

Conversation

@dhensle

@dhensle dhensle commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator

Overview
This PR implements both the intra-household AV allocation and taxi/TNC routing models for the ABM3 system.

Implementation Details

  • Intra-household AV allocation model
  • Taxi/TNC routing algorithm with optimized vehicle assignment
  • Configurable parameters for vehicle occupancy, wait times, and batch processing
  • Performance optimizations for large households/trips

Testing Results & Model Performance
The TNC routing model has been tested and validated with the following performance metrics:

TNC Trip Statistics

  • Total TNC Vehicle Trips: 413,714
  • Total TNC Trips: 205,277
  • Total Vehicles: 7,648
  • TNC Trips to Vehicles Ratio: 26.84
  • Average Trips per Vehicle: 54.09

Service Quality Metrics

  • Average Initial Wait Time: 2.60 minutes
  • Average Detour Time per Passenger (pooled trips): 4.28 minutes

Vehicle Efficiency Metrics

  • Percentage of Deadhead Vehicle Trips: 50.31%
  • Average Occupancy (all vehicle trips): 0.95
  • Average Occupancy (weighted by VMT): 1.62
  • Total Refuel Trips: 3,160 (0.76% of all vehicle trips)

VMT Analysis

  • Total VMT from TNC Vehicle Trips: 1,708,092.80 miles
  • Total Deadhead VMT: 235,714.59 miles
  • Percentage of Deadhead VMT: 13.80%

For runtime improvements, here is a quick comparison from Iteration 3 (100% sample). In total, the

  • Java AV allocation model + TNC routing model: 0:36:45
  • Python Taxi/TNC routing model + AV and TNC matrix builder: 0:02:30

This translates to a total runtime savings of roughly 90–100 minutes for the AV/TNC routing components across all three iterations.

Below shows the summary comparing between new Python algorithm and old Java algorithm:
image
The new Python algorithm shows significantly improved fleet efficiency but with trade-offs in service quality:
Key Improvements ✓

  • 57% reduction in total vehicles needed (7,648 vs 17,635)
  • 147% increase in average trips per vehicle (54.09 vs 21.89)
  • 13% increase in trips-to-vehicles ratio (26.84 vs 23.76)

Performance Trade-offs ⚠️

  • 27% increase in deadhead trips (50.31% vs 39.45%)
  • 13% decrease in average occupancy (0.95 vs 1.09)
  • 7% increase in total vehicle trips (413,714 vs 386,084)

The new python algorithm does not have significant impact to mode share and regional VMT, as shown in the figure below from Model Comparison Report:
image

image

The new Python algorithm also fixes the bug in Java program (below was from RSG developing work):
image

Comment thread src/asim/extensions/av_routing.py
Comment thread src/asim/extensions/av_routing.py

@JiaXu1024 JiaXu1024 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.

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?

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

Copilot AI left a comment

Copy link
Copy Markdown

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.

Comment thread src/asim/extensions/av_routing.py
Comment thread src/asim/scripts/taxi_tnc_routing/taxi_tnc_routing_settings.yaml
Comment thread src/asim/configs/resident/av_repositioning.csv
Comment thread src/asim/configs/resident/av_repositioning.csv
Comment thread src/asim/configs/resident/av_repositioning.csv
Comment thread docs/design/demand/resident.md Outdated
@dhensle
dhensle marked this pull request as ready for review January 30, 2026 23:55
@dhensle

dhensle commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator Author

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

dhensle commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator Author

@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
@JiaXu1024
JiaXu1024 requested review from bhargavasana and removed request for aber-sandag February 12, 2026 22:20
Comment thread docs/design/demand/resident.md Outdated
Comment thread src/asim/configs/resident/av_repositioning.csv Outdated
Comment thread src/asim/configs/resident/av_repositioning_preprocessor.csv Outdated
Comment thread src/asim/configs/resident/av_repositioning_preprocessor.csv Outdated
Comment thread src/asim/configs/resident/av_repositioning_preprocessor.csv
Comment thread src/asim/configs/resident/av_repositioning.csv
Comment thread src/asim/configs/resident/av_trip_matching_preprocessor.csv Outdated
Comment thread src/asim/configs/resident/av_trip_matching_preprocessor.csv Outdated
@aber-sandag aber-sandag mentioned this pull request Jun 30, 2026
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.

the new Python TNX routing test shows discrepancy between input demand and output.

5 participants