Repository navigation
2025-10-09 Engineering Team #31
Description
Activity
Update on the error consolidation task: I have inventoried every RuntimeError in the v1.5.0 codebase (skipping some tests and the old PSRC example) and put the results in an Excel file that includes the file, line number, message, and some context about what is happening (I then added fields for the suggested error to replace
RuntimeErrorwith). The results so far are in the draft PR #1000. Between replacingRuntimeErrorwith new and existing exceptions, we're down to 13 Runtime errors, and I feel like there's more that can be removed.Reacted by Andrew KayHere are alternative meeting notes generated by Claude Sonnet 4.5. I didn't find anything technically incorrect with the above notes, but I find this more conversational format easier to digest...
ActivitySim Engineering Meeting Notes
Meeting Overview
Agenda
- PopulationSim version numbering decision
- Explicit Error Term (EET) next steps and prioritization
- Park and Ride solution methodology review
- 11B task status updates (deferred)
Participants
- Joe Castiglione, Zephyr Foundation (@joecastiglione)
- Jeff Newman, Driftless (@jpn--)
- David Hensle, RSG (@dhensle)
- Joel Freedman, RSG (@jfdman)
- Sijia Wang, WSP (@i-am-sijia)
- Stefan Coe, PSRC (@stefancoe)
- Guy Rousseau, ARC (@guyrousseau)
- Jilan Chen, SEMCOG (@JilanChen)
- Cherry Liu, SEMCOG
- Sumit Bindra, TransLink
Duration
Approximately 60 minutes
Executive Summary
The team decided to release PopulationSim as version 0.10 to avoid confusion with intermediate version numbers. Discussion on EET runtime improvements identified three potential approaches: random number generation updates, simple random sampling, and stratified random sampling for destination choice models. The team will reach out to Bentley for insights and develop scoped proposals for the random number generation and sampling investigations. David Hensle presented a new park and ride methodology that selects lots before tour mode choice, eliminates the need for park and ride skims, and implements capacity constraints through iterative resimulation.
Meeting Notes
PopulationSim Version Numbering
The team discussed version numbering for the upcoming PopulationSim release. The last consortium release was version 0.5.1, but RSG's pull request showed version 0.9.2 in the pyproject.toml file. To avoid confusion with any intermediate versions that may have been used by individual agencies, the team decided to skip ahead to version 0.10 for the next release. A note will be included in the release explaining the version number gap.
Explicit Error Term (EET) Development
Runtime performance remains the primary concern for EET implementation, with destination choice models accounting for most of the additional runtime. Three potential approaches were discussed for improving performance:
Random Number Generation: The current implementation reseeds the random number generator for each use, which is expensive. Modern generators like NumPy's default (128-bit state) could store state efficiently as two doubles per entity. This would require careful implementation but could benefit all models, not just EET. Joel noted that similar approaches were used in CTRAMP with arrays to track random number advancement.
Simple Random Sampling: Moving from importance sampling to simple random sampling for destination choice could significantly reduce runtime since it eliminates the need for two exponentiations per alternative. This is primarily a software implementation issue.
Stratified Random Sampling: Similar to approaches used in SFCHAMP, this could solve the runtime problem but would require extensive testing to ensure model sensitivities remain stable.
Sumit reported that Bentley presented at the Momo conference claiming they solved the runtime explosion problem. The team agreed to reach out to Bentley to learn about their approach before proceeding with development. Joel noted that Peter has been investigating simple random sampling as a potential solution.
Joe expressed support for investigating both random number generation and sampling methods. He noted concerns about the implications of changing sampling methods for existing models, suggesting it should be implemented as a switch. He questioned whether the disaggregate accessibilities investigation should be prioritized, noting unexplained anomalies in unaffected zones but expressing uncertainty about resource allocation.
Joel emphasized that testing stratified random sampling has both software and modeling components requiring extensive sensitivity testing, while random number generation updates are primarily software issues. The engineering team will develop discrete scopes with cost estimates for these three elements for consortium review and prioritization.
Park and Ride Solution Methodology
David Hensle presented a comprehensive new approach to park and ride modeling in ActivitySim.
Current Implementation Limitations: Most ActivitySim models rely on assignment software to generate park and ride skims as hyperpaths across multiple lots. This makes it impossible to track individual lot choices, difficult to implement capacity constraints, and typically prohibits stops on park and ride tours. The park and ride skims are expensive, effectively doubling transit skim requirements.
Proposed Methodology: The new approach adds park and ride lot choice as a model component that runs before tour mode choice. The model calculates utilities using auto times from origin to lot and walk-transit times from lot to destination. This explicit lot selection enables several improvements:
- Eliminates the need for park and ride skims, using only auto and walk-transit skims
- Provides direct control over utility specifications including terminal time and lot-specific costs
- Enables capacity tracking and constraint enforcement
- Allows for both formal and informal parking capacity designation
Capacity Constraint Implementation: When lots reach capacity, the model identifies tours arriving after the lot fills based on time of day and resamples only those tours. These tours can then select alternative lots or switch to different modes. The implementation uses a simulation-based constraint mechanism similar to location choice shadow pricing but counts actual demand rather than applying shadow prices. Tours are only constrained to change mode, not destination or time of day.
Key Design Considerations: Park and ride lot choice runs during both tour mode choice and logsum calculations. Lots that fill remain closed for the entire day rather than reopening when vehicles depart, which is appropriate for planning purposes given that demand after morning peak is minimal. The model filters out destinations without transit access to reduce unnecessary calculations.
Guy asked about cardinal orientation (i.e. geography), which is handled through the utility calculations where longer drive or transit times create disadvantages. Joe questioned the time of day implementation, noting that tours are simulated simultaneously rather than sequentially through the day. David confirmed that capacity enforcement considers arrival time when determining which tours to resample.
Stefan noted the behavioral advantage of this approach over pure shadow pricing, as later arrivals are less likely to find spaces. Jeff reinforced that planning model requirements differ from operational models, making the simplified daily closure approach appropriate and cost-effective.
Jilan asked about informal parking, which can be designated in separate land use fields and included in total capacity calculations. Sijia questioned whether alternative design options were considered; David explained the team focused on iteration scope, deciding that iterating only tour mode choice provides the right balance of responsiveness and implementation complexity.
Cherry asked about tracking in/out flows and whether lot choice would be skipped when capacity is met. David clarified that lots remain closed once full, and when no capacity exists anywhere, park and ride becomes unavailable through tour mode choice availability conditions.
Stefan asked whether park and ride zones can be independent MAZs; David confirmed any valid zone in the land use table with capacity greater than zero is eligible for selection.
Implementation Status: The methodology has been implemented but full-scale testing has not been completed. Next steps include convergence testing, runtime validation, and model sensitivity verification. The team acknowledged the need to establish how this functionality will be incorporated into example models for integration testing.
11B Task Status Updates
Due to time constraints, the team deferred discussion of 11B task status updates. The next week's engineering call was cancelled, with participants asked to provide asynchronous status updates on the meeting thread.
Action Items
- Engineering Team: Develop discrete scopes and cost estimates for three EET improvement approaches: random number generation updates, simple random sampling investigation, and stratified random sampling investigation
- Engineering Team (Jeff Newman or designee): Contact Bentley to inquire about their EET runtime solution presented at MoMo conference
- Engineering Team: Include assessment of model outcome impacts when scoping sampling method changes
- Product/Community/Executive Teams: Review and prioritize scoped EET improvement proposals once submitted
- RSG (David Hensle): Complete full-scale testing of park and ride implementation including convergence, runtime, and sensitivity analysis
- Consortium: Determine approach for incorporating park and ride functionality into example models
- All Teams with 11B Tasks: Provide asynchronous status updates on meeting thread
- Joe Castiglione: Cancel next week's engineering meeting (October 16th)
@ActivitySim/engineering
Agenda
Meeting Notes: Zephyr Foundation Engineering Call
Date: 2025-10-09
Duration: 1 hour 1 minute
Attendees: Joe Castiglione, Sijia Wang, Jeff Newman, David Hensle, Stefan Coe, Sumit, Joel Freedman, Guy Rousseau, Jilan Chen, Cherry Liu
1. Population Sim Release Version Discussion
Discussion
Decision
2. Explicit Error Term (EET) Runtime Optimization
Current Issues
Three Proposed Approaches
A. Random Number Generation Modernization
B. Sampling Method Changes
C. Disaggregate Accessibilities Investigation
External Input
Action Items
Consensus
3. Park and Ride (P&R) Methodology and Implementation
Presenter: David Hensle
Current P&R Implementation (Most ActivitySim Models)
Proposed New Methodology
Core Concept
Benefits
Capacity Constraint Mechanism
Time-of-Day Handling
Implementation Details
Questions Raised
Joe (Zephyr Foundation)
Guy Rousseau
Stefan Coe
Jilan Chen
Sijia Wang
Cherry Liu
Limitations
Status
Next Steps
4. 11B Tasks Status Check (Deferred)
Decision
Action Items Summary
Next Meeting