You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect origin TAZ for non-home tours in 2 zone models #1099
There was a bug found in the identification of origin TAZs in at-work subtours. The at-work subtour’s MAZ origin was already identified correctly. The bug was in the derived TAZ used for two-zone destination presampling.
The bug was discovered in the SANDAG at-work subtour destination model. It correctly configures both ORIG_ZONE_ID and CHOOSER_ORIG_COL_NAME as workplace_zone_id. The merged chooser table at this model retained a TAZ representing the traveler’s home. The code reused that column instead of mapping workplace_zone_id to the correct origin TAZ. Consequently, at-work subtours could use:
the correct workplace MAZ as their configured origin, but
the traveler’s home TAZ as the coarse origin used for TAZ-level presampling.
PR #1094 now always maps the configured origin MAZ to its TAZ, replacing any unrelated same-named TAZ column.
Regression impact
In the 100-household SANDAG test model:
16 of the 23 at-work subtours receive corrected destination_logsum values.
The modeled origins and chosen destinations remain unchanged.
One of the 229 tour logsums differs enough to exceed the regression tolerance, causing test to fail.
Both test_sandag_abm3_progressive[False] and [True] fail on final_tours.csv.
The failure is limited to the destination_logsum column.
Regenerate test/regress/final_tours.csv with an ActivitySim revision containing the fix. All corrected at-work logsum values should be accepted, rather than updating only the one value that currently exceeds the comparison tolerance.
Refresh the two reference pipelines:
reference-pipeline-hh100.parquetpipeline
reference-pipeline-hh100-recode.parquetpipeline
Their existing rtol=1e-4 comparison tolerates the changes, so they are not causing the red CI result, but their at-work destination checkpoints still represent the old calculation.
Thanks for flagging this. My understanding is that the at-work subtour MAZ origin (workplace_zone_id) was correct, but in the affected code path the TAZ-level presampling could use the person's home TAZ rather than the TAZ corresponding to the workplace. I am guessing this could affect the sampled alternatives and the destination-choice/logsum calculations for some at-work subtours.
Since TAZ referenced here is an internal chooser/presampling column and SANDAG's standard tour file does not have TAZs, we are unable to detect this mismatch in the output. We will plan on getting this fix when we upgrade to the next ActivitySim release (v1.6.0).
Activity
bhargavasana commentedon Aug 12, 2026
Thanks for flagging this. My understanding is that the at-work subtour MAZ origin (
workplace_zone_id) was correct, but in the affected code path the TAZ-level presampling could use the person's home TAZ rather than the TAZ corresponding to the workplace. I am guessing this could affect the sampled alternatives and the destination-choice/logsum calculations for some at-work subtours.Since
TAZreferenced here is an internal chooser/presampling column and SANDAG's standard tour file does not have TAZs, we are unable to detect this mismatch in the output. We will plan on getting this fix when we upgrade to the next ActivitySim release (v1.6.0).