Skip to content

Commit 1951adf

Browse files
authored
Merge pull request #1 from wsp-sag/asim-v1.3-integration
ActivitySim v1.3 and Sharrow Compatible
2 parents 8e042f8 + 59cd7d3 commit 1951adf

37 files changed

+261
-207
lines changed

configs/_dummy_coefficients.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coefficient_name,value,constrain
2+
coef_one,1,T

configs/atwork_subtour_destination.csv

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Distance_square_oth,"@np.where((df.tour_type == 'maint'), ((np.minimum(skims[('S
1212
OPOP logsum for work purpose,"@np.where((df.tour_type == 'business'), (df.mode_choice_logsum), 0)",1
1313
OPOP logsum for eating out purpose,"@np.where((df.tour_type == 'eat'), (df.mode_choice_logsum), 0)",1
1414
OPOP logsum for other purpose,"@np.where((df.tour_type == 'maint'), (df.mode_choice_logsum), 0)",1
15-
Size variable applied for work purposes,"@np.where((df.tour_type == 'business'), df['atwork'].apply(np.log1p), 0)",0.461
16-
Size variable applied for eating out purposes,"@np.where((df.tour_type == 'eat'), df['atwork'].apply(np.log1p), 0)",0.6904
17-
Size variable applied for other purposes,"@np.where((df.tour_type == 'maint'), df['atwork'].apply(np.log1p), 0)",0.6166
15+
Size variable applied for work purposes,"@np.where((df.tour_type == 'business'), df['size_term'].apply(np.log1p), 0)",0.461
16+
Size variable applied for eating out purposes,"@np.where((df.tour_type == 'eat'), df['size_term'].apply(np.log1p), 0)",0.6904
17+
Size variable applied for other purposes,"@np.where((df.tour_type == 'maint'), df['size_term'].apply(np.log1p), 0)",0.6166
1818
# shortWalkOrig == 1 for all purposes,,
1919
Not SOV on mandatory tour & short walk,"@(~df.tour_mode.isin(['DRIVEALONEFREE','DRIVEALONEPAY']))",2.485
20-
No Eat subtour Attractions,"@np.where(((df.tour_type == 'eat') & (df['atwork'].apply(np.log1p) == 0)), 1, 0)",-999
21-
No Business subtour Attractions,"@np.where(((df.tour_type == 'business') & (df['atwork'].apply(np.log1p) == 0)), 1, 0)",-999
22-
No Maint subtour Attractions,"@np.where(((df.tour_type == 'maint') & (df['atwork'].apply(np.log1p) == 0)), 1, 0)",-999
20+
No Eat subtour Attractions,"@np.where(((df.tour_type == 'eat') & (df['size_term'].apply(np.log1p) == 0)), 1, 0)",-999
21+
No Business subtour Attractions,"@np.where(((df.tour_type == 'business') & (df['size_term'].apply(np.log1p) == 0)), 1, 0)",-999
22+
No Maint subtour Attractions,"@np.where(((df.tour_type == 'maint') & (df['size_term'].apply(np.log1p) == 0)), 1, 0)",-999
2323
Distance,"@(np.minimum(skims[('SOV_FREE_DISTANCE', 'MD')], 20))",0.135698
2424
Distance squared,"@((np.minimum(skims[('SOV_FREE_DISTANCE', 'MD')], 20)) ** 2)",-0.0123613
2525
Distance cubed,"@((np.minimum(skims[('SOV_FREE_DISTANCE', 'MD')], 20)) ** 3)",0.0001337
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Description,Expression,atwork
22
offpeak period sov distance,"@skims[('SOV_FREE_DISTANCE', 'MD')]",-0.2
3-
Size variable ,@df['atwork'].apply(np.log1p),1
4-
No attractions,@df['atwork']==0,-999
3+
Size variable ,@df['size_term'].apply(np.log1p),1
4+
No attractions,@df['size_term']==0,-999

configs/auto_ownership.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@ NESTS:
1717

1818
SPEC: auto_ownership.csv
1919
COEFFICIENTS: auto_ownership_coeffs.csv
20-
21-
LOGSUM_CHOOSER_COLUMNS:
22-
- num_drivers
23-
- num_workers
24-

configs/cdap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22
INDIV_AND_HHSIZE1_SPEC: cdap_indiv_and_hhsize1.csv
3+
COEFFICIENTS: _dummy_coefficients.csv
4+
INTERACTION_COEFFICIENTS: cdap_interaction_coefficients.csv
35

46
FIXED_RELATIVE_PROPORTIONS_SPEC: cdap_fixed_relative_proportions.csv
57

configs/logging.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,34 @@ logging:
1919
handlers: [console, logfile]
2020
propagate: false
2121

22-
orca:
22+
sharrow:
2323
level: WARN
2424
handlers: [console, logfile]
2525
propagate: false
2626

27+
black:
28+
# sharrow uses black to reformat code, but we don't generally care
29+
# about messages emitted by black unless they are serious
30+
level: WARN
31+
32+
blib2to3:
33+
# this is a vendored library within black that we also want to squelch
34+
level: WARN
35+
2736
handlers:
2837

2938
logfile:
3039
class: logging.FileHandler
31-
filename: !!python/object/apply:activitysim.core.config.log_file_path ['activitysim.log']
40+
filename:
41+
get_log_file_path: activitysim.log
3242
mode: w
3343
formatter: fileFormatter
3444
level: NOTSET
3545

3646
console:
3747
class: logging.StreamHandler
3848
stream: ext://sys.stdout
39-
formatter: simpleFormatter
49+
formatter: elapsedFormatter
4050
level: NOTSET
4151

4252
formatters:
@@ -52,3 +62,7 @@ logging:
5262
format: '%(asctime)s - %(levelname)s - %(name)s - %(message)s'
5363
datefmt: '%d/%m/%Y %H:%M:%S'
5464

65+
elapsedFormatter:
66+
(): activitysim.core.tracing.ElapsedTimeFormatter
67+
format: '[{elapsedTime}] {levelname:s}: {message:s}'
68+
style: '{'

configs/mandatory_tour_frequency.csv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Can walk to work - Retired interaction,(ptype == 5) & (distance_to_work < 3),0,0
2525
Can walk to school - University student interaction,(ptype == 3) & (distance_to_school < 3),0,0,0,0.7114,0
2626
Can walk to school - Driving-age child interaction,(ptype == 6) & (distance_to_school < 3),0,0,0,0.7114,0
2727
Can walk to school - Pre-driving age child who is in school interaction,((ptype == 7)|(ptype == 8)) & (distance_to_school < 3),0,0,0,0.7114,0
28-
Can walk to work or school - Full-time worker interaction,(ptype == 1) & (distance_to_work < 3 | distance_to_school < 3),0,0,0,0,0.1391
29-
Can walk to work or school - Part-time worker interaction,(ptype == 2) & (distance_to_work < 3 | distance_to_school < 3),0,0,0,0,0.1391
30-
Can walk to work or school - University student interaction,(ptype == 3) & (distance_to_work < 3 | distance_to_school < 3),0,0,0,0,0.1391
31-
Can walk to work or school - Driving-age child interaction,(ptype == 6) & (distance_to_work < 3 | distance_to_school < 3),0,0,0,0,0.1391
28+
Can walk to work or school - Full-time worker interaction,(ptype == 1) & ((distance_to_work) < 3 | (distance_to_school < 3)),0,0,0,0,0.1391
29+
Can walk to work or school - Part-time worker interaction,(ptype == 2) & ((distance_to_work < 3) | (distance_to_school < 3)),0,0,0,0,0.1391
30+
Can walk to work or school - University student interaction,(ptype == 3) & ((distance_to_work < 3) | (distance_to_school < 3)),0,0,0,0,0.1391
31+
Can walk to work or school - Driving-age child interaction,(ptype == 6) & ((distance_to_work < 3) | (distance_to_school < 3)),0,0,0,0,0.1391
3232
Round trip auto time to work - Full-time worker interaction,(ptype == 1) * roundtrip_auto_time_to_work,0,-0.003518,0,0,-0.003124
3333
Round trip auto time to work - Part-time worker interaction,(ptype == 2) * roundtrip_auto_time_to_work,0,-0.003518,0,0,-0.003124
3434
Round trip auto time to work - University student interaction,(ptype == 3) * roundtrip_auto_time_to_work,0,-0.003518,0,0,-0.003124

configs/mandatory_tour_scheduling.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@ DESTINATION_FOR_TOUR_PURPOSE:
5454
work: workplace_zone_id
5555
school: school_zone_id
5656
univ: school_zone_id
57+
58+
explicit_chunk: 0.2

configs/non_mandatory_tour_destination.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Description,Expression,escort,escortkids,escortnokids,shopping,eatout,othmaint,social,othdiscr
22
Mode choice logsum,mode_choice_logsum,1,1,1,coef_shopping_mode_logsum,coef_eatout_mode_logsum,coef_othmaint_mode_logsum,1,1
3-
Intrazonal,@(df['zone_id']==df['home_zone_id']),0,0,0,0,0,0,0,0
3+
Intrazonal,@(df['alt_dest']==df['home_zone_id']),0,0,0,0,0,0,0,0
44
CBD area type,@df['is_CBD'],0,0,0,coef_shopping_cbd,coef_eatout_cbd,coef_othmaint_cbd,coef_social_cbd,0
55
Urban high area type,@df['is_urban'],0,0,0,coef_shopping_urban,coef_eatout_urban,coef_othmaint_urban,coef_social_urban,coef_othdiscr_urban
66
"# CTRAMP expression has two 'Distance' coefficients. For example, 0.2553 and 0.0100 for Escort, so used their sum here",,,,,,,,,
77
Distance,"@skims[('SOV_FREE_DISTANCE', 'MD')]",coef_escort_distance,coef_escortkids_distance,coef_escortnokids_distance,coef_shopping_distance,coef_eatout_distance,coef_othmaint_distance,coef_social_distance,coef_othdiscr_distance
88
Distance squared,"@(skims[('SOV_FREE_DISTANCE', 'MD')] ** 2)",coef_escort_distance_squared,coef_escortkids_distance_squared,coef_escortnokids_distance_squared,coef_shopping_distance_squared,coef_eatout_distance_squared,coef_othmaint_distance_squared,coef_social_distance_squared,coef_othdiscr_distance_squared
99
Distance cubed,"@(skims[('SOV_FREE_DISTANCE', 'MD')] ** 3)",coef_escort_distance_cubed,coef_escortkids_distance_cubed,coef_escortnokids_distance_cubed,coef_shopping_distance_cubed,coef_eatout_distance_cubed,coef_othmaint_distance_cubed,coef_social_distance_cubed,coef_othdiscr_distance_cubed
1010
Log of distance,"@np.log(skims[('SOV_FREE_DISTANCE', 'MD')])",coef_escort_log_distance,coef_escortkids_log_distance,coef_escortnokids_log_distance,coef_shopping_log_distance,coef_eatout_log_distance,coef_othmaint_log_distance,coef_social_log_distance,coef_othdiscr_log_distance
11-
Distance - high income,"@((df['income_in_thousands']>50) & skims[('SOV_FREE_DISTANCE', 'MD')])",0,0,0,0,coef_eatout_distance_high_income,0,0,0
11+
Distance - high income,"@((df['income_in_thousands']>50) * skims[('SOV_FREE_DISTANCE', 'MD')])",0,0,0,0,coef_eatout_distance_high_income,0,0,0
1212
Distance - non-driving age student in hh,"@np.where(df['num_nondriving_age_children']>0, skims[('SOV_FREE_DISTANCE', 'MD')], 0)",coef_escort_distance_nondrive,coef_escortkids_distance_nondrive,coef_escortnokids_distance_nondrive,coef_shopping_distance_nondrive,0,0,coef_social_distance_nondrive,coef_othdiscr_distance_nondrive
1313
Distance bin 0 to 1,"@((skims[('SOV_FREE_DISTANCE', 'MD')]>=0) & (skims[('SOV_FREE_DISTANCE', 'MD')]<1))",0,0,0,coef_shopping_dist_0_1,coef_eatout_dist_0_1,coef_othmaint_dist_0_1,0,coef_othdiscr_dist_0_1
1414
Distance bin 1 to 2,"@((skims[('SOV_FREE_DISTANCE', 'MD')]>=1) & (skims[('SOV_FREE_DISTANCE', 'MD')]<2))",0,0,0,coef_shopping_dist_1_2,coef_eatout_dist_1_2,coef_othmaint_dist_1_2,0,coef_othdiscr_dist_1_2

configs/non_mandatory_tour_frequency.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ util_presence_of_university_student_and_maintenance_tour,Dummy for Presence of U
139139
util_presence_of_driving_school_kid_and_maintenance_tour,Dummy for Presence of Driving School Kid (other than modeled person) & Maintenance tour ,has_driving_kid * othmaint,coef_presence_of_driving_school_kid_and_maintenance_tour,coef_presence_of_driving_school_kid_and_maintenance_tour,coef_presence_of_driving_school_kid_and_maintenance_tour,coef_presence_of_driving_school_kid_and_maintenance_tour,coef_presence_of_driving_school_kid_and_maintenance_tour,coef_presence_of_driving_school_kid_and_maintenance_tour,coef_presence_of_driving_school_kid_and_maintenance_tour,coef_presence_of_driving_school_kid_and_maintenance_tour
140140
util_presence_of_pre_driving_school_kid_and_maintenance_tour,Dummy for Presence of Pre-Driving School Kid (other than modeled person) & Maintenance tour ,has_school_kid * othmaint,coef_presence_of_pre_driving_school_kid_and_maintenance_tour,coef_presence_of_pre_driving_school_kid_and_maintenance_tour,coef_presence_of_pre_driving_school_kid_and_maintenance_tour,coef_presence_of_pre_driving_school_kid_and_maintenance_tour,coef_presence_of_pre_driving_school_kid_and_maintenance_tour,coef_presence_of_pre_driving_school_kid_and_maintenance_tour,coef_presence_of_pre_driving_school_kid_and_maintenance_tour,coef_presence_of_pre_driving_school_kid_and_maintenance_tour
141141
util_presence_of_pre_school_kid_and_maintenance_tour,Dummy for Presence of Pre-School Kid (other than modeled person) & Maintenance tour ,has_preschool_kid * othmaint,coef_presence_of_pre_school_kid_and_maintenance_tour,coef_presence_of_pre_school_kid_and_maintenance_tour,coef_presence_of_pre_school_kid_and_maintenance_tour,coef_presence_of_pre_school_kid_and_maintenance_tour,coef_presence_of_pre_school_kid_and_maintenance_tour,coef_presence_of_pre_school_kid_and_maintenance_tour,coef_presence_of_pre_school_kid_and_maintenance_tour,coef_presence_of_pre_school_kid_and_maintenance_tour
142-
util_at_home_pre_driving_school_kid_and_maintenance_tour,Dummy for At home Pre-Driving School Kid & Maintenance tour ,has_school_kid_at_home * othmaint,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour
142+
util_at_home_pre_driving_school_kid_and_maintenance_tour,Dummy for At home Pre-Driving School Kid & Maintenance tour ,df.has_school_kid_at_home * df.othmaint,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour,coef_at_home_pre_driving_school_kid_and_maintenance_tour
143143
util_at_home_pre_school_kid_and_maintenance_tour,Dummy for At homef Pre-School Kid & Maintenance tour ,has_preschool_kid_at_home * othmaint,coef_at_home_pre_school_kid_and_maintenance_tour,coef_at_home_pre_school_kid_and_maintenance_tour,coef_at_home_pre_school_kid_and_maintenance_tour,coef_at_home_pre_school_kid_and_maintenance_tour,coef_at_home_pre_school_kid_and_maintenance_tour,coef_at_home_pre_school_kid_and_maintenance_tour,coef_at_home_pre_school_kid_and_maintenance_tour,coef_at_home_pre_school_kid_and_maintenance_tour
144144
util_presence_of_full_time_worker_and_eating_out_tour,Dummy for Presence of Full time Worker (other than modeled person) & Eating Out tour ,has_full_time * eatout,coef_presence_of_full_time_worker_and_eating_out_tour,coef_presence_of_full_time_worker_and_eating_out_tour,coef_presence_of_full_time_worker_and_eating_out_tour,coef_presence_of_full_time_worker_and_eating_out_tour,coef_presence_of_full_time_worker_and_eating_out_tour,coef_presence_of_full_time_worker_and_eating_out_tour,coef_presence_of_full_time_worker_and_eating_out_tour,coef_presence_of_full_time_worker_and_eating_out_tour
145145
util_presence_of_part_time_worker_and_eating_out_tour,Dummy for Presence of Part time Worker (other than modeled person) & Eating Out tour ,has_part_time * eatout,coef_presence_of_part_time_worker_and_eating_out_tour,coef_presence_of_part_time_worker_and_eating_out_tour,coef_presence_of_part_time_worker_and_eating_out_tour,coef_presence_of_part_time_worker_and_eating_out_tour,coef_presence_of_part_time_worker_and_eating_out_tour,coef_presence_of_part_time_worker_and_eating_out_tour,coef_presence_of_part_time_worker_and_eating_out_tour,coef_presence_of_part_time_worker_and_eating_out_tour

0 commit comments

Comments
 (0)