Skip to content

Commit 6d1f473

Browse files
jpn--i-am-sijia
andauthored
Sync production v15.3.1 + Sharrow (#39)
* abm3 v15.2.1 updates * delete external_workplace_location_archive.csv * revert settings change * use miniforge * use existing skims .omx * from v15.2.1 to v15.3.1 * script for automatically diffing * fix bugs in example specs * small fix for running w sharrow * update non-sharrow ref parquet * add tele status to mp settings * update non-sharrow ref * tour mode choice spec sharrow changes * add guidance on how to use the auto diff script * add option to diff wrt to any branch of SANDAG/ABM * improve legibility * remove expressions that add constants to trips df * tidy example MAZ skims * use constants not data columns in spec * add purpose index num to preprocessor for sharrow * update targets for legacy test * update targets for sharrow test * example script for small sharrow model * works with sharrow 2.15 and activitysim 1.5 * run-large-sharrow * more readme * one fulldata script for sharrow and legacy * locks * mp scripts * update requirements * reduce rtol to 1e-4 for cross platform testing * require sharrow 2.15 * add flags to limit multithreading on test * log env * update test regression targets * pin to source not release --------- Co-authored-by: Sijia Wang <wangsijia0628@gmail.com>
1 parent 788a4de commit 6d1f473

258 files changed

Lines changed: 633599 additions & 652782 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,3 @@ jobs:
5858
run: |
5959
source .venv/bin/activate
6060
pytest ./test
61-

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,31 @@ in this repository, using this command:
1212
```
1313
activitysim run -c configs/common -c configs/resident -d data -o output -s settings_mp.yaml --ext extensions
1414
```
15+
16+
# Git diff with the ABM3 production model
17+
18+
The current guideline is that this example model _should_ be consistent with the [production model](https://github.com/SANDAG/ABM).
19+
20+
You can run the `diff_production_configs.py` script in this repo to automatically diff the example model configs with the production model configs.
21+
22+
## Usage
23+
Basic exmaple - diff resident configs:
24+
```
25+
# Diff the resident configs of the latest release of production and the main branch of example
26+
uv run python diff_production_configs.py -d resident
27+
```
28+
29+
Specify release or branch of the production model with `-p`, branch of the example model with `-e`, and the subdirectory with `-d`:
30+
```
31+
# Diff specific release of production, branch of example, and subdirectory
32+
uv run python diff_production_configs.py -p v15.3.1 -e main -d common
33+
34+
# Diff specific branch of production, branch of example, and subdirectory
35+
uv run python diff_production_configs.py -p main -e sharrow-test -d common
36+
```
37+
38+
Show full diff output, not just file names:
39+
```
40+
# with full output
41+
uv run python diff_production_configs.py -p v15.3.1 -e main -d common --full
42+
```

configs/common/constants.yaml

Lines changed: 55 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@ NO_EXTERNAL: 0
88
# set below to be 1 for years before 2021, 0 otherwise
99
PRE_COVID: 0
1010

11-
walk_speed: 3 #mph
12-
13-
#HHT_NONE: 0
14-
#HHT_FAMILY_MARRIED: 1
15-
#HHT_FAMILY_MALE: 2
16-
#HHT_FAMILY_FEMALE: 3
17-
#HHT_NONFAMILY_MALE_ALONE: 4
18-
#HHT_NONFAMILY_MALE_NOTALONE: 5
19-
#HHT_NONFAMILY_FEMALE_ALONE: 6
20-
#HHT_NONFAMILY_FEMALE_NOTALONE: 7
21-
2211
# convenience for expression files
2312
HHT_NONFAMILY: [4, 5, 6, 7]
2413
HHT_FAMILY: [1, 2, 3]
@@ -94,7 +83,7 @@ distributed_time_factor_max: 10
9483

9584
c_drive: 1.5
9685

97-
useAV: 0
86+
AV_OWNERSHIP_TARGET_PERCENT: 0.0
9887
autoIVTFactorAV: 0.75
9988
autoParkingCostFactorAV: 0.5
10089
autoCostPerMileFactorAV: 0.7
@@ -103,34 +92,15 @@ minAgeDriveAloneAV: 13
10392

10493

10594
#valueOfTime: 8.00
106-
costPerMile: 18.29
107-
costShareSr2: 1.75
108-
costShareSr3: 2.50
109-
waitThresh: 10.00
110-
walkThresh: 1.50
95+
costPerMile: 32.5
11196
shortWalk: 0.333
112-
longWalk: 0.667
11397
walkSpeed: 3.00
114-
bikeThresh: 6.00
11598
bikeSpeed: 7.80
11699
ebikeSpeed: 10.00
117100
escooterSpeed: 6.70
118101
driveSpeed: 25.00
119-
maxCbdAreaTypeThresh: 2
120102
indivTour: 1.00000
121103

122-
#### [NICK] WHAT ARE THESE? DO WE EVEN NEED THESE?
123-
upperEA: 5
124-
upperAM: 10
125-
upperMD: 15
126-
upperPM: 19
127-
128-
# SHOULD IT BE THIS?
129-
# upperEA: 6
130-
# upperAM: 12
131-
# upperMD: 25
132-
# upperPM: 32
133-
134104
### Crosswalk between SOC codes and SANDAG occupation classification
135105
soc_occupation_xwalk:
136106
11: mngt_busi_scic_arts # 11 - Management Occupations
@@ -159,9 +129,9 @@ soc_occupation_xwalk:
159129
99: # 99 - Non-workers, Code not part of SOC system
160130

161131
# RIDEHAIL Settings
162-
Taxi_baseFare: 2.20
163-
Taxi_costPerMile: 2.30
164-
Taxi_costPerMinute: 0.10
132+
Taxi_baseFare: 3
133+
Taxi_costPerMile: 3.3
134+
Taxi_costPerMinute: 0.46
165135
Taxi_waitTime_mean:
166136
1: 5.5
167137
2: 9.5
@@ -175,10 +145,10 @@ Taxi_waitTime_sd:
175145
3: 6.4
176146
4: 6.4
177147
5: 6.4
178-
TNC_single_baseFare: 2.20
179-
TNC_single_costPerMile: 1.33
180-
TNC_single_costPerMinute: 0.24
181-
TNC_single_costMinimum: 7.20
148+
TNC_single_baseFare: 3.31
149+
TNC_single_costPerMile: 0.96
150+
TNC_single_costPerMinute: 0.33
151+
TNC_single_costMinimum: 9.19
182152
TNC_single_waitTime_mean:
183153
1: 3.0
184154
2: 6.3
@@ -191,10 +161,10 @@ TNC_single_waitTime_sd:
191161
3: 4.1
192162
4: 4.1
193163
5: 4.1
194-
TNC_shared_baseFare: 2.20
195-
TNC_shared_costPerMile: 0.53
196-
TNC_shared_costPerMinute: 0.10
197-
TNC_shared_costMinimum: 3.00
164+
TNC_shared_baseFare: 1.66
165+
TNC_shared_costPerMile: 0.48
166+
TNC_shared_costPerMinute: 0.16
167+
TNC_shared_costMinimum: 4.6
198168
TNC_shared_IVTFactor: 1.5
199169
TNC_shared_waitTime_mean:
200170
1: 5.0
@@ -210,35 +180,25 @@ TNC_shared_waitTime_sd:
210180
5: 4.1
211181
min_waitTime: 0
212182
max_waitTime: 50
183+
wait_time_distribution_by_density_breaks:
184+
- 500
185+
- 2000
186+
- 5000
187+
- 15000
213188

214-
ivt_lrt_multiplier: 0.65
189+
# rapid bus wait time discount
190+
WAIT_TIME_DISC: 1.0
191+
192+
ivt_lrt_multiplier: 0.85
215193
ivt_brt_multiplier: 0.95
216-
ivt_cmr_multiplier: 0.65
194+
ivt_cmr_multiplier: 0.85
217195
ivt_ltd_multiplier: 1.0
218-
ivt_cost_multiplier: 0.6
219196
# line-haul mode constants; note commuter rail is based on CMRIVTT. Also currently hyperloop is not applied because we do not skim hyperloop IVTT
220197
eb_equiv_asc: 10
221198
brt_equiv_asc: -5
222-
lrt_equiv_asc: -20
223-
hyp_equiv_asc: -20
199+
lrt_equiv_asc: -30
224200
pnr_lrt_equiv_asc: -20
225201
#
226-
walktimeshort_multiplier: 2
227-
walktimelong_multiplier: 10
228-
biketimeshort_multiplier: 4
229-
biketimelong_multiplier: 20
230-
short_i_wait_multiplier: 2
231-
long_i_wait_multiplier: 1
232-
wacc_multiplier: 2
233-
wegr_multiplier: 2
234-
waux_multiplier: 2
235-
dtim_multiplier: 2
236-
xwait_multiplier: 2
237-
dacc_ratio: 0
238-
xfers_wlk_multiplier: 10
239-
xfers_drv_multiplier: 20
240-
drvtrn_distpen_0_multiplier: 270
241-
drvtrn_distpen_max: 15
242202
density_index_multiplier: -0.2
243203
# joint_sr2_ASC_no_auto: 0
244204
# joint_sr2_ASC_auto_deficient: 0
@@ -262,11 +222,9 @@ zoo_maz: 10561
262222
torrypines_maz: 4093
263223

264224
# Micromobility constants
265-
microSpeed: 12
266-
microVarCost: 20 #cents
225+
microVarCost: 39 #cents
267226
microFixedCost: 100 #cents
268227
microRentTime: 1
269-
microConstant: 60
270228
microAccessThreshold: 100
271229
ebikeownership: 0.008
272230
ebikeMaxDist: 10.50
@@ -277,20 +235,46 @@ microtransitSpeed: 30
277235
microtransitCost: 125 #cents
278236
microtransitWaitTime: 12
279237
microtransitMaxDist: 4.5
280-
microtransitDiversionConstant: 5
238+
microtransitDiversionConstant: 6
281239
microtransitDiversionFactor: 1.25
240+
microtransitStartPeriod: 9
241+
microtransitEndPeriod: 32
282242
nevSpeed: 17
283243
nevCost: 125 #cents
284244
nevWaitTime: 12
285245
nevMaxDist: 3
286246
nevDwellMinutesPerMile: 0.5
287-
nevDiversionConstant: 5
247+
nevDiversionConstant: 6
288248
nevDiversionFactor: 1.25
289-
maxWalkIfMTAccessAvailable: 0.5 # Maximum distance to walk to premium transit if microtransit access is available
249+
nevStartPeriod: 9
250+
nevEndPeriod: 38
251+
maxWalkIfMTAccessAvailable: 1.0 # Maximum distance to walk to premium transit if microtransit access is available
290252

291253
# cost of "average" monthly transit pass cost. Used in transit pass ownership model.
292254
# cost of pass divided by 2 for age < 18 and 65+.
293255
monthly_transit_pass_cost: 100
294256

295257
# year after which a vehicle (therefore its household) must have transponder
296-
hhTR_Vehyear: 2035
258+
hhTR_Vehyear: 2029
259+
260+
# SHARED2 and SHARED3 Occupancies
261+
OCC_SHARED2: 2.0
262+
OCC_SHARED3: 3.33
263+
# add TNC and Taxi Occupancies
264+
OCC_TAXI: 1.1
265+
OCC_TNC_SINGLE: 1.2
266+
OCC_TNC_SHARED: 2.0
267+
268+
# EV Rebate constants
269+
LowIncomeEVRebateCutoff: 3
270+
MedIncomeEVRebateCutoff: 4
271+
LowIncomeBEVRebate: 0
272+
LowIncomePEVRebate: 0
273+
MedIncomeBEVRebate: 0
274+
MedIncomePEVRebate: 0
275+
276+
# MGRAs for Ports of Entry
277+
SanYsidro_maz_id: 9279
278+
OtayMesa_maz_id: 9387
279+
Tecate_maz_id: 22324
280+
OtayMesaEast_maz_id: 7123

configs/common/network_los.yaml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@ read_skim_cache: False
1010
# write memmapped cached skims to output directory after reading from omx, for use in subsequent runs
1111
write_skim_cache: False
1212

13-
# taz_skims:
14-
# - traffic_skims_processed_EA.omx
15-
# - traffic_skims_processed_AM.omx
16-
# - traffic_skims_processed_MD.omx
17-
# - traffic_skims_processed_PM.omx
18-
# - traffic_skims_processed_EV.omx
19-
# #- transit_skims_processed.omx
20-
# - transit_skims_EA.omx
21-
# - transit_skims_AM.omx
22-
# - transit_skims_MD.omx
23-
# - transit_skims_PM.omx
24-
# - transit_skims_EV.omx
25-
2613
# series15
2714
taz_skims:
2815
- traffic_skims*.omx
@@ -41,8 +28,6 @@ maz_to_maz:
4128
skim_time_periods:
4229
time_window: 1440
4330
period_minutes: 30
44-
# periods: [0, 11, 17, 30, 37, 48] # asim xborder
45-
# periods: [0, 3, 9, 22, 29, 48] # ctramp xborder
4631
periods: [0, 6, 12, 25, 32, 48] # time periods to match documentation
4732
labels: &skim_time_period_labels ['EA', 'AM', 'MD', 'PM', 'EV']
4833

@@ -51,25 +36,3 @@ demographic_segments: &demographic_segments
5136
- &high_income_segment_id 1
5237

5338

54-
55-
# CONSTANTS:
56-
# c_ivt: -0.028
57-
# c_cost: -0.0011
58-
# # transit "factors" from SANDAG
59-
# eb_fac: 1.0
60-
# brt_fac: 0.9000
61-
# lrt_fac: 0.6500
62-
# cr_fac: 0.6500
63-
# hyp_fac: 0.6500
64-
# # coeffs used in maz_tap and tap_tap utility expressions
65-
# c_walk: 1.7
66-
# c_fwt: 1.5
67-
# c_waux: 2.5
68-
# c_xwt: 2
69-
# C_UNAVAILABLE: -9999
70-
# # alternative-specific constants
71-
# exp_asc: 10 # express bus asc
72-
# brt_asc: -10 # BRT asc
73-
# lrt_asc: -20 # LRT alternative-specific constant
74-
# cr_asc: 0.00 # Commuter Rail alternative-specific constant
75-

0 commit comments

Comments
 (0)