From c458040109cb316a9fba2fb96a509abf7d4feb06 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Mon, 13 May 2024 19:42:24 -0400 Subject: [PATCH 01/19] config update --- configs/_dummy_coefficients.csv | 2 ++ configs/atwork_subtour_destination.csv | 12 +++---- configs/atwork_subtour_destination_sample.csv | 4 +-- configs/auto_ownership.yaml | 5 --- configs/cdap.yaml | 2 ++ configs/logging.yaml | 3 +- configs/parking_location_choice.yaml | 26 +++++++++----- configs/school_location.csv | 2 +- configs/stop_frequency.yaml | 34 ++++++++++++++++++- configs/tour_mode_choice_coeffs_template.csv | 2 -- configs/trip_departure_choice.yaml | 22 ++++++------ configs/trip_mode_choice_coeffs.csv | 2 +- configs/trip_scheduling_choice.yaml | 29 +++++++++------- configs/workplace_location.csv | 2 +- 14 files changed, 94 insertions(+), 53 deletions(-) create mode 100644 configs/_dummy_coefficients.csv diff --git a/configs/_dummy_coefficients.csv b/configs/_dummy_coefficients.csv new file mode 100644 index 0000000..2b8df50 --- /dev/null +++ b/configs/_dummy_coefficients.csv @@ -0,0 +1,2 @@ +coefficient_name,value,constrain +coef_one,1,T diff --git a/configs/atwork_subtour_destination.csv b/configs/atwork_subtour_destination.csv index 3411956..eb86c48 100644 --- a/configs/atwork_subtour_destination.csv +++ b/configs/atwork_subtour_destination.csv @@ -12,14 +12,14 @@ Distance_square_oth,"@np.where((df.tour_type == 'maint'), ((np.minimum(skims[('S OPOP logsum for work purpose,"@np.where((df.tour_type == 'business'), (df.mode_choice_logsum), 0)",1 OPOP logsum for eating out purpose,"@np.where((df.tour_type == 'eat'), (df.mode_choice_logsum), 0)",1 OPOP logsum for other purpose,"@np.where((df.tour_type == 'maint'), (df.mode_choice_logsum), 0)",1 -Size variable applied for work purposes,"@np.where((df.tour_type == 'business'), df['atwork'].apply(np.log1p), 0)",0.461 -Size variable applied for eating out purposes,"@np.where((df.tour_type == 'eat'), df['atwork'].apply(np.log1p), 0)",0.6904 -Size variable applied for other purposes,"@np.where((df.tour_type == 'maint'), df['atwork'].apply(np.log1p), 0)",0.6166 +Size variable applied for work purposes,"@np.where((df.tour_type == 'business'), df['size_term'].apply(np.log1p), 0)",0.461 +Size variable applied for eating out purposes,"@np.where((df.tour_type == 'eat'), df['size_term'].apply(np.log1p), 0)",0.6904 +Size variable applied for other purposes,"@np.where((df.tour_type == 'maint'), df['size_term'].apply(np.log1p), 0)",0.6166 # shortWalkOrig == 1 for all purposes,, Not SOV on mandatory tour & short walk,"@(~df.tour_mode.isin(['DRIVEALONEFREE','DRIVEALONEPAY']))",2.485 -No Eat subtour Attractions,"@np.where(((df.tour_type == 'eat') & (df['atwork'].apply(np.log1p) == 0)), 1, 0)",-999 -No Business subtour Attractions,"@np.where(((df.tour_type == 'business') & (df['atwork'].apply(np.log1p) == 0)), 1, 0)",-999 -No Maint subtour Attractions,"@np.where(((df.tour_type == 'maint') & (df['atwork'].apply(np.log1p) == 0)), 1, 0)",-999 +No Eat subtour Attractions,"@np.where(((df.tour_type == 'eat') & (df['size_term'].apply(np.log1p) == 0)), 1, 0)",-999 +No Business subtour Attractions,"@np.where(((df.tour_type == 'business') & (df['size_term'].apply(np.log1p) == 0)), 1, 0)",-999 +No Maint subtour Attractions,"@np.where(((df.tour_type == 'maint') & (df['size_term'].apply(np.log1p) == 0)), 1, 0)",-999 Distance,"@(np.minimum(skims[('SOV_FREE_DISTANCE', 'MD')], 20))",0.135698 Distance squared,"@((np.minimum(skims[('SOV_FREE_DISTANCE', 'MD')], 20)) ** 2)",-0.0123613 Distance cubed,"@((np.minimum(skims[('SOV_FREE_DISTANCE', 'MD')], 20)) ** 3)",0.0001337 diff --git a/configs/atwork_subtour_destination_sample.csv b/configs/atwork_subtour_destination_sample.csv index 212a171..ce7e008 100644 --- a/configs/atwork_subtour_destination_sample.csv +++ b/configs/atwork_subtour_destination_sample.csv @@ -1,4 +1,4 @@ Description,Expression,atwork offpeak period sov distance,"@skims[('SOV_FREE_DISTANCE', 'MD')]",-0.2 -Size variable ,@df['atwork'].apply(np.log1p),1 -No attractions,@df['atwork']==0,-999 +Size variable ,@df['size_term'].apply(np.log1p),1 +No attractions,@df['size_term']==0,-999 diff --git a/configs/auto_ownership.yaml b/configs/auto_ownership.yaml index 9e85945..09540f1 100644 --- a/configs/auto_ownership.yaml +++ b/configs/auto_ownership.yaml @@ -17,8 +17,3 @@ NESTS: SPEC: auto_ownership.csv COEFFICIENTS: auto_ownership_coeffs.csv - -LOGSUM_CHOOSER_COLUMNS: - - num_drivers - - num_workers - \ No newline at end of file diff --git a/configs/cdap.yaml b/configs/cdap.yaml index 0cbf11d..a37f633 100644 --- a/configs/cdap.yaml +++ b/configs/cdap.yaml @@ -1,5 +1,7 @@ INDIV_AND_HHSIZE1_SPEC: cdap_indiv_and_hhsize1.csv +COEFFICIENTS: _dummy_coefficients.csv +INTERACTION_COEFFICIENTS: cdap_interaction_coefficients.csv FIXED_RELATIVE_PROPORTIONS_SPEC: cdap_fixed_relative_proportions.csv diff --git a/configs/logging.yaml b/configs/logging.yaml index a30a25c..d5f3768 100644 --- a/configs/logging.yaml +++ b/configs/logging.yaml @@ -28,7 +28,8 @@ logging: logfile: class: logging.FileHandler - filename: !!python/object/apply:activitysim.core.config.log_file_path ['activitysim.log'] + filename: + get_log_file_path: activitysim.log mode: w formatter: fileFormatter level: NOTSET diff --git a/configs/parking_location_choice.yaml b/configs/parking_location_choice.yaml index e482870..3199658 100644 --- a/configs/parking_location_choice.yaml +++ b/configs/parking_location_choice.yaml @@ -1,12 +1,12 @@ -METADATA: - CHOOSER: trips_merged - INPUT: - persons: - trips: - tours: - OUTPUT: - trips: - - parking_zone_id +# METADATA: +# CHOOSER: trips_merged +# INPUT: +# persons: +# trips: +# tours: +# OUTPUT: +# trips: +# - parking_zone_id SPECIFICATION: parking_location_choice.csv COEFFICIENTS: parking_location_choice_coeffs.csv @@ -34,3 +34,11 @@ SEGMENTS: ALT_DEST_COL_NAME: parking_zone_id TRIP_ORIGIN: origin TRIP_DESTINATION: destination + +AUTO_MODES: + - DRIVEALONEFREE + - DRIVEALONEPAY + - SHARED2FREE + - SHARED2PAY + - SHARED3FREE + - SHARED3PAY \ No newline at end of file diff --git a/configs/school_location.csv b/configs/school_location.csv index 1dedf7f..cb40c77 100644 --- a/configs/school_location.csv +++ b/configs/school_location.csv @@ -1,6 +1,6 @@ Description,Expression,univ,k12_predrive,k12_drive Mode choice logsum,mode_choice_logsum,coeff_mode_univ,coeff_mode_k12_predrive,coeff_mode_k12_drive -Intrazonal (origin == dest),@(df['home_zone_id']==df['zone_id']),-0.1518,-0.5708,-0.5708 +Intrazonal (origin == dest),@(df['home_zone_id']==df['alt_dest']),-0.1518,-0.5708,-0.5708 Distance,"@skims[('SOV_FREE_DISTANCE', 'MD')]",0.00726,0.3526869,0.3526869 CBD Area Type,@df['areatype']==1,0.5678,-0.6092,-0.6092 Urban Area Type,"@(df['areatype'].isin([2,3,4]))",0,-1.759,-1.759 diff --git a/configs/stop_frequency.yaml b/configs/stop_frequency.yaml index 80aaab8..84de5de 100644 --- a/configs/stop_frequency.yaml +++ b/configs/stop_frequency.yaml @@ -7,7 +7,39 @@ preprocessor: - persons - land_use - accessibility - + +SPEC_SEGMENTS: + - primary_purpose: work + SPEC: stop_frequency_work.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: school + SPEC: stop_frequency_school.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: univ + SPEC: stop_frequency_univ.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: social + SPEC: stop_frequency_social.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: shopping + SPEC: stop_frequency_shopping.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: eatout + SPEC: stop_frequency_eatout.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: escort + SPEC: stop_frequency_escort.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: othmaint + SPEC: stop_frequency_othmaint.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: othdiscr + SPEC: stop_frequency_othdiscr.csv + COEFFICIENTS: _dummy_coefficients.csv + - primary_purpose: atwork + SPEC: stop_frequency_atwork.csv + COEFFICIENTS: _dummy_coefficients.csv + CONSTANTS: TRANSIT_MODES: - WALK_ALLTRN diff --git a/configs/tour_mode_choice_coeffs_template.csv b/configs/tour_mode_choice_coeffs_template.csv index ea79fc8..c273c08 100644 --- a/configs/tour_mode_choice_coeffs_template.csv +++ b/configs/tour_mode_choice_coeffs_template.csv @@ -71,5 +71,3 @@ coef_schBus_Rural,coef_schBus_Rural_work,coef_schBus_Rural_univ,coef_schBus_Rura coef_schBus_odDistgre10Mile,coef_schBus_odDistgre10Mile_work,coef_schBus_odDistgre10Mile_univ,coef_schBus_odDistgre10Mile_school,coef_schBus_odDistgre10Mile_nonmandatory,coef_schBus_odDistgre10Mile_nonmandatory,coef_schBus_odDistgre10Mile_nonmandatory,coef_schBus_odDistgre10Mile_nonmandatory,coef_schBus_odDistgre10Mile_nonmandatory,coef_schBus_odDistgre10Mile_nonmandatory,coef_schBus_odDistgre10Mile_atwork coef_schBus_departBef8am,coef_schBus_departBef8am_work,coef_schBus_departBef8am_univ,coef_schBus_departBef8am_school,coef_schBus_departBef8am_nonmandatory,coef_schBus_departBef8am_nonmandatory,coef_schBus_departBef8am_nonmandatory,coef_schBus_departBef8am_nonmandatory,coef_schBus_departBef8am_nonmandatory,coef_schBus_departBef8am_nonmandatory,coef_schBus_departBef8am_atwork coef_schBus_returnBef5pm,coef_schBus_returnBef5pm_work,coef_schBus_returnBef5pm_univ,coef_schBus_returnBef5pm_school,coef_schBus_returnBef5pm_nonmandatory,coef_schBus_returnBef5pm_nonmandatory,coef_schBus_returnBef5pm_nonmandatory,coef_schBus_returnBef5pm_nonmandatory,coef_schBus_returnBef5pm_nonmandatory,coef_schBus_returnBef5pm_nonmandatory,coef_schBus_returnBef5pm_atwork -coef_hov_tourPur_Esc,coef_hov_tourPur_Esc_work,coef_hov_tourPur_Esc_univ,coef_hov_tourPur_Esc_school,coef_hov_tourPur_Esc_nonmandatory,coef_hov_tourPur_Esc_nonmandatory,coef_hov_tourPur_Esc_nonmandatory,coef_hov_tourPur_Esc_nonmandatory,coef_hov_tourPur_Esc_nonmandatory,coef_hov_tourPur_Esc_nonmandatory,coef_hov_tourPur_Esc_atwork -coef_hov_tourPur_Eat,coef_hov_tourPur_Eat_work,coef_hov_tourPur_Eat_univ,coef_hov_tourPur_Eat_school,coef_hov_tourPur_Eat_nonmandatory,coef_hov_tourPur_Eat_nonmandatory,coef_hov_tourPur_Eat_nonmandatory,coef_hov_tourPur_Eat_nonmandatory,coef_hov_tourPur_Eat_nonmandatory,coef_hov_tourPur_Eat_nonmandatory,coef_hov_tourPur_Eat_atwork diff --git a/configs/trip_departure_choice.yaml b/configs/trip_departure_choice.yaml index daf657b..fb1aa8d 100644 --- a/configs/trip_departure_choice.yaml +++ b/configs/trip_departure_choice.yaml @@ -1,16 +1,16 @@ -METADATA: - CHOOSER: tours - INPUT: - persons: - trips: - tours: - OUTPUT: - trips: - - start_period - - end_period +# METADATA: +# CHOOSER: tours +# INPUT: +# persons: +# trips: +# tours: +# OUTPUT: +# trips: +# - start_period +# - end_period SPECIFICATION: trip_departure_choice.csv -COEFFICIENTS: trip_departure_choice_coeff.csv +# COEFFICIENTS: trip_departure_choice_coeff.csv PREPROCESSOR: diff --git a/configs/trip_mode_choice_coeffs.csv b/configs/trip_mode_choice_coeffs.csv index 57a93cd..676bbc8 100644 --- a/configs/trip_mode_choice_coeffs.csv +++ b/configs/trip_mode_choice_coeffs.csv @@ -1,4 +1,4 @@ -Expression,work,univ,school,escort,shopping,eatout,othmaint,social,othdiscr,atwork +coefficient_name,work,univ,school,escort,shopping,eatout,othmaint,social,othdiscr,atwork c_ivt,-0.03705,-0.03705,-0.01272,-0.03213,-0.03213,-0.03213,-0.03213,-0.03213,-0.03213,-0.03213 c_ovt,0,0,-0.02544,0,0,0,0,0,0,0 c_pnrTime,-0.0741,-0.0741,-0.0254,-0.0643,-0.0643,-0.0643,-0.0643,-0.0643,-0.0643,0 diff --git a/configs/trip_scheduling_choice.yaml b/configs/trip_scheduling_choice.yaml index f7a9171..43c0891 100644 --- a/configs/trip_scheduling_choice.yaml +++ b/configs/trip_scheduling_choice.yaml @@ -1,22 +1,25 @@ -METADATA: - CHOOSER: tours - INPUT: - persons: - trips: - tours: - OUTPUT: - trips: - - start_period - - end_period +# METADATA: +# CHOOSER: tours +# INPUT: +# persons: +# trips: +# tours: +# OUTPUT: +# trips: +# - start_period +# - end_period SPECIFICATION: trip_scheduling_choice.csv -COEFFICIENTS: trip_scheduling_choice_coeff.csv +# COEFFICIENTS: trip_scheduling_choice_coeff.csv -SAMPLE_ALTERNATIVES: trip_departure_sample_patterns.csv +# SAMPLE_ALTERNATIVES: trip_departure_sample_patterns.csv PREPROCESSOR: SPEC: trip_scheduling_choice_preprocessor DF: tours TABLES: - persons - - trips \ No newline at end of file + - trips + +compute_settings: + protect_columns: ["schedule_id"] \ No newline at end of file diff --git a/configs/workplace_location.csv b/configs/workplace_location.csv index 4daabb4..d311111 100644 --- a/configs/workplace_location.csv +++ b/configs/workplace_location.csv @@ -1,6 +1,6 @@ Description,Expression,white_collar,service,health,retail_food,blue_collar Mode choice logsum,mode_choice_logsum,0.65,0.65,0.65,0.65,0.65 -Intrazonal (origin == dest),@(df['zone_id']==df['home_zone_id']),0.9833,0.9833,0.9833,0.9833,0.9833 +Intrazonal (origin == dest),@(df['alt_dest']==df['home_zone_id']),0.9833,0.9833,0.9833,0.9833,0.9833 Distance,"@skims[('SOV_FREE_DISTANCE', 'MD')]",0.014674,0.014674,0.014674,0.014674,0.014674 Distance Squared,"@(skims[('SOV_FREE_DISTANCE', 'MD')] ** 2)",-0.000135,-0.000135,-0.000135,-0.000135,-0.000135 Distance Cubed,"@(skims[('SOV_FREE_DISTANCE', 'MD')] ** 3)",0.000001119,0.000001119,0.000001119,0.000001119,0.000001119 From 7a937042229e1c7d5435d3cedfee451edb7a93d0 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Mon, 13 May 2024 20:33:08 -0400 Subject: [PATCH 02/19] disable chunking --- configs/settings.yaml | 2 +- configs/settings_mp.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/settings.yaml b/configs/settings.yaml index 2eb9ffa..5837c68 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -180,7 +180,7 @@ multiprocess_steps: - name: mp_households begin: school_location num_processes: 28 - chunk_size: 300000000 + # chunk_size: 300000000 slice: tables: - households diff --git a/configs/settings_mp.yaml b/configs/settings_mp.yaml index d16803c..c8de1ab 100644 --- a/configs/settings_mp.yaml +++ b/configs/settings_mp.yaml @@ -125,7 +125,7 @@ trace_hh_id: 333650 #trace_hh_id: 2 #trace_hh_id: 1643904 -chunk_size: 300000000 +# chunk_size: 300000000 models: - initialize_landuse From 65ebf29939c2b7c9d8c9330fa7058f526935f833 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Tue, 14 May 2024 10:46:07 -0400 Subject: [PATCH 03/19] drop land_use from accessibility slice except --- configs/settings.yaml | 4 ++-- configs/settings_mp.yaml | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/configs/settings.yaml b/configs/settings.yaml index 5837c68..0c5724b 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -1,3 +1,5 @@ +households_sample_size: 100 + # input tables input_table_list: - tablename: households @@ -173,8 +175,6 @@ multiprocess_steps: slice: tables: - accessibility - except: - - land_use - name: mp_initialize_households begin: initialize_households - name: mp_households diff --git a/configs/settings_mp.yaml b/configs/settings_mp.yaml index c8de1ab..ff4a066 100644 --- a/configs/settings_mp.yaml +++ b/configs/settings_mp.yaml @@ -178,8 +178,6 @@ multiprocess_steps: slice: tables: - accessibility - except: - - land_use - name: mp_initialize_households begin: initialize_households - name: mp_households From aa87a40365b694f905233a166a4203da62432564 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Wed, 29 May 2024 11:22:08 -0400 Subject: [PATCH 04/19] run 100% HH with explicit chunking --- configs/mandatory_tour_scheduling.yaml | 2 ++ configs/non_mandatory_tour_scheduling.yaml | 1 + configs/parking_location_choice.yaml | 4 +++- configs/school_location.yaml | 2 ++ configs/settings.yaml | 4 +++- configs/trip_destination.yaml | 4 +++- configs/workplace_location.yaml | 2 +- 7 files changed, 15 insertions(+), 4 deletions(-) diff --git a/configs/mandatory_tour_scheduling.yaml b/configs/mandatory_tour_scheduling.yaml index 7317325..f7d0bec 100644 --- a/configs/mandatory_tour_scheduling.yaml +++ b/configs/mandatory_tour_scheduling.yaml @@ -54,3 +54,5 @@ DESTINATION_FOR_TOUR_PURPOSE: work: workplace_zone_id school: school_zone_id univ: school_zone_id + +explicit_chunk: 0.2 \ No newline at end of file diff --git a/configs/non_mandatory_tour_scheduling.yaml b/configs/non_mandatory_tour_scheduling.yaml index d89ad8b..b0e2d94 100644 --- a/configs/non_mandatory_tour_scheduling.yaml +++ b/configs/non_mandatory_tour_scheduling.yaml @@ -32,3 +32,4 @@ SIMULATE_CHOOSER_COLUMNS: - num_add_shop_maint_tours - num_add_soc_discr_tours +explicit_chunk: 0.2 \ No newline at end of file diff --git a/configs/parking_location_choice.yaml b/configs/parking_location_choice.yaml index 3199658..64e36e2 100644 --- a/configs/parking_location_choice.yaml +++ b/configs/parking_location_choice.yaml @@ -41,4 +41,6 @@ AUTO_MODES: - SHARED2FREE - SHARED2PAY - SHARED3FREE - - SHARED3PAY \ No newline at end of file + - SHARED3PAY + +explicit_chunk: 0.2 \ No newline at end of file diff --git a/configs/school_location.yaml b/configs/school_location.yaml index 639a849..989748b 100644 --- a/configs/school_location.yaml +++ b/configs/school_location.yaml @@ -58,3 +58,5 @@ MODELED_SIZE_TABLE: school_modeled_size # not loaded if commented out SAVED_SHADOW_PRICE_TABLE_NAME: school_shadow_prices.csv + +explicit_chunk: 0.2 \ No newline at end of file diff --git a/configs/settings.yaml b/configs/settings.yaml index 0c5724b..785c376 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -1,4 +1,4 @@ -households_sample_size: 100 +households_sample_size: 0 # input tables input_table_list: @@ -123,6 +123,8 @@ skims_file: skims.omx use_shadow_pricing: True # chunk_size: +chunk_method: hybrid_uss +chunk_training_mode: explicit models: - initialize_landuse diff --git a/configs/trip_destination.yaml b/configs/trip_destination.yaml index 7d40a68..78d0e36 100644 --- a/configs/trip_destination.yaml +++ b/configs/trip_destination.yaml @@ -37,4 +37,6 @@ preprocessor: CLEANUP: False # this setting is used by testing code to force failed trip_destination -# fail_some_trips_for_testing: False \ No newline at end of file +# fail_some_trips_for_testing: False + +explicit_chunk: 0.2 \ No newline at end of file diff --git a/configs/workplace_location.yaml b/configs/workplace_location.yaml index 5fa2cff..1498e9d 100644 --- a/configs/workplace_location.yaml +++ b/configs/workplace_location.yaml @@ -68,4 +68,4 @@ MODELED_SIZE_TABLE: workplace_modeled_size # not loaded if commented out SAVED_SHADOW_PRICE_TABLE_NAME: workplace_shadow_prices.csv - +explicit_chunk: 0.2 From ccef2655c980abc07aa4189639da50678c29e2c8 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Wed, 24 Jul 2024 12:52:15 -0400 Subject: [PATCH 05/19] sharrow logging --- configs/logging.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/logging.yaml b/configs/logging.yaml index d5f3768..3b1bfdd 100644 --- a/configs/logging.yaml +++ b/configs/logging.yaml @@ -19,7 +19,7 @@ logging: handlers: [console, logfile] propagate: false - orca: + sharrow: level: WARN handlers: [console, logfile] propagate: false From 0a081c69c744371b497d4d659e5ae3eb35f44ef4 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Wed, 24 Jul 2024 12:52:49 -0400 Subject: [PATCH 06/19] correct mand tour freq spec --- configs/mandatory_tour_frequency.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/mandatory_tour_frequency.csv b/configs/mandatory_tour_frequency.csv index 4e7a9fe..b6e6861 100644 --- a/configs/mandatory_tour_frequency.csv +++ b/configs/mandatory_tour_frequency.csv @@ -25,10 +25,10 @@ Can walk to work - Retired interaction,(ptype == 5) & (distance_to_work < 3),0,0 Can walk to school - University student interaction,(ptype == 3) & (distance_to_school < 3),0,0,0,0.7114,0 Can walk to school - Driving-age child interaction,(ptype == 6) & (distance_to_school < 3),0,0,0,0.7114,0 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 -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 -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 -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 -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 +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 +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 +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 +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 Round trip auto time to work - Full-time worker interaction,(ptype == 1) * roundtrip_auto_time_to_work,0,-0.003518,0,0,-0.003124 Round trip auto time to work - Part-time worker interaction,(ptype == 2) * roundtrip_auto_time_to_work,0,-0.003518,0,0,-0.003124 Round trip auto time to work - University student interaction,(ptype == 3) * roundtrip_auto_time_to_work,0,-0.003518,0,0,-0.003124 From baa0171f30876b377280fad6746782dcbd8e608c Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Wed, 24 Jul 2024 12:53:11 -0400 Subject: [PATCH 07/19] problematic tour mode choice spec --- configs/tour_mode_choice.csv | 4 ++-- configs/tour_mode_choice_annotate_choosers_preprocessor.csv | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configs/tour_mode_choice.csv b/configs/tour_mode_choice.csv index 5bf0de6..2a48bb4 100644 --- a/configs/tour_mode_choice.csv +++ b/configs/tour_mode_choice.csv @@ -254,8 +254,8 @@ SCHOOLBUS - Grade school pre-driver,"@np.where(df.is_school, (coef_schBus_PreDri SCHOOLBUS - Grade school driver,"@np.where(df.is_school, coef_schBus_Driver * df.is_driving_age, 0)",,,,,,,,,,,,,,,1 SCHOOLBUS - Rural/exurban destination,"@np.where(df.is_school, coef_schBus_Rural * df.is_rural_or_exurban, 0)",,,,,,,,,,,,,,,1 SCHOOLBUS - o/d distance greater than 10 miles,"@np.where(df.is_school, coef_schBus_odDistgre10Mile * (odt_skims['SOV_FREE_DISTANCE']>10), 0)",,,,,,,,,,,,,,,1 -SCHOOLBUS - Depart from home before 8 am (downstream model),"@np.where(df.is_school, todOut<2 , 0)",,,,,,,,,,,,,,, -SCHOOLBUS - Return to home before 5 pm (downstream model),"@np.where(df.is_school, todIn<6, 0)",,,,,,,,,,,,,,, +SCHOOLBUS - Depart from home before 8 am (downstream model),"@np.where(df.is_school, df.dep_before_8_am , 0)",,,,,,,,,,,,,,, +SCHOOLBUS - Return to home before 5 pm (downstream model),"@np.where(df.is_school, df.ret_before_5_pm, 0)",,,,,,,,,,,,,,, SCHOOLBUS - In-vehicle time (ERROR-all probabilities are zero for 1204 rows),"@np.where(df.is_school, coef_ivt*(odt_skims['SOV_FREE_DISTANCE']+dot_skims['SOV_FREE_DISTANCE'])*60/schoolBusSpeed, 0)",,,,,,,,,,,,,,,1 SCHOOLBUS - Out-of-vehicle time,"@np.where(df.is_school, coef_ovt*schoolBusOvt, 0)",,,,,,,,,,,,,,,1 #,,,,,,,,,,,,,,,, diff --git a/configs/tour_mode_choice_annotate_choosers_preprocessor.csv b/configs/tour_mode_choice_annotate_choosers_preprocessor.csv index 439d1b1..f8b02c6 100644 --- a/configs/tour_mode_choice_annotate_choosers_preprocessor.csv +++ b/configs/tour_mode_choice_annotate_choosers_preprocessor.csv @@ -88,6 +88,8 @@ Depart before 6 AM (todOut==1),dep_wk_before_6_am,(df.out_period.isin(['EA'])) Depart after 4 PM (todOut>4 was used in work expressions),dep_wk_after_4_pm,(df.out_period.isin(['EV'])) Depart after 4 PM (for non-mandatory and at-work expressions),dep_after_4_pm,"(df.start > 26) if 'start' in df.columns else (df.out_period.isin(['PM','EV']))" "Arrive after 7PM (in java code, it was defined based on depart period)",arr_after_7_pm,(df.end > 32) if 'end' in df.columns else (df.in_period.isin(['EV'])) +Depart from home before 8 am,dep_before_8_am,"(df.start <= 10) if 'start' in df.columns else (df.out_period.isin(['EA']))" +Return home before 5 pm,ret_before_5_pm,"(df.end <= 28) if 'end' in df.columns else ~(df.in_period.isin(['EV']))" #,, destination in central business district,destination_in_cbd,"(reindex(land_use.CBDFlag, df[dest_col_name]))>0" Inc_PCTLT10K,Inc_PCTLT10K,"(np.minimum(np.maximum(df.I_PCTLT10K,5),30)-5)/25" From a752f2f07a58a96a39d421896d8ce1c811ac0673 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Wed, 24 Jul 2024 18:46:22 -0400 Subject: [PATCH 08/19] make sharrow compatible --- configs/non_mandatory_tour_destination.csv | 4 ++-- configs/tour_scheduling_joint.csv | 10 ++++++---- configs/tour_scheduling_nonmandatory.csv | 8 ++++---- configs/trip_mode_choice.csv | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/configs/non_mandatory_tour_destination.csv b/configs/non_mandatory_tour_destination.csv index 0f3c647..8665b61 100644 --- a/configs/non_mandatory_tour_destination.csv +++ b/configs/non_mandatory_tour_destination.csv @@ -1,6 +1,6 @@ Description,Expression,escort,escortkids,escortnokids,shopping,eatout,othmaint,social,othdiscr Mode choice logsum,mode_choice_logsum,1,1,1,coef_shopping_mode_logsum,coef_eatout_mode_logsum,coef_othmaint_mode_logsum,1,1 -Intrazonal,@(df['zone_id']==df['home_zone_id']),0,0,0,0,0,0,0,0 +Intrazonal,@(df['alt_dest']==df['home_zone_id']),0,0,0,0,0,0,0,0 CBD area type,@df['is_CBD'],0,0,0,coef_shopping_cbd,coef_eatout_cbd,coef_othmaint_cbd,coef_social_cbd,0 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 "# CTRAMP expression has two 'Distance' coefficients. For example, 0.2553 and 0.0100 for Escort, so used their sum here",,,,,,,,, @@ -8,7 +8,7 @@ Distance,"@skims[('SOV_FREE_DISTANCE', 'MD')]",coef_escort_distance,coef_escortk 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 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 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 -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 +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 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 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 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 diff --git a/configs/tour_scheduling_joint.csv b/configs/tour_scheduling_joint.csv index ed7609c..36d7de5 100644 --- a/configs/tour_scheduling_joint.csv +++ b/configs/tour_scheduling_joint.csv @@ -68,7 +68,7 @@ ESCORT - Duration Constant: 1.5hrs,@((df.tour_category == 'joint') & (df.tour_ty ESCORT - Duration Constant: 2 hrs,@((df.tour_category == 'joint') & (df.tour_type == 'escort') & (df.duration==4)),-1.071871358 ESCORT - Duration Constant: Longer than 2 hrs,@((df.tour_category == 'joint') & (df.tour_type == 'escort') & (df.duration>4)),-1.691098421 ESCORT - Calibration Constant - Duration = 1,@((df.tour_category == 'joint') & (df.tour_type == 'escort') & (df.duration==0)),-0.047200214 -ESCORT - Calibration Constant - Duration = 2,@(((df.tour_category == 'joint') & (df.tour_type == 'escort') & df.duration==1)),0.035611332 +ESCORT - Calibration Constant - Duration = 2,@((df.tour_category == 'joint') & (df.tour_type == 'escort') & (df.duration==1)),0.035611332 ESCORT - Calibration Constant - Departure = 9,@((df.tour_category == 'joint') & (df.tour_type == 'escort') & (df.start==9)),0.106814756 ESCORT - Calibration Constant - Departure = 10,@((df.tour_category == 'joint') & (df.tour_type == 'escort') & (df.start==10)),0.215386864 ESCORT - Calibration Constant - Departure = 23,@((df.tour_category == 'joint') & (df.tour_type == 'escort') & (df.start==23)),-0.255087318 @@ -111,7 +111,7 @@ SHOPPING - Departure Constant: 10:00 AM - 10:30 AM,@((df.tour_category == 'joint SHOPPING - Departure Constant: 10:30 AM - 11:00 AM,@((df.tour_category == 'joint') & (df.tour_type == 'shopping') & (df.start==16)),-0.309421311 SHOPPING - Departure Constant: After 11:00 AM,@((df.tour_category == 'joint') & (df.tour_type == 'shopping') & (df.start>16)),-0.541073357 SHOPPING - Departure Constant: Shift for every 30 minutes after 11:30 am - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'shopping') & (df.start>17)), (np.where((df.start<12), np.minimum(12-df.start,7),0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)), 0)",-0.072013428 -SHOPPING - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'shopping') & (df.start>17)), ((np.where((df.start<12), np.minimum(12-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)) ** 2), 0)",-0.000653398 +SHOPPING - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'shopping') & (df.start>17)), ((np.where((df.start<12), np.minimum(12-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)).astype(np.int64) ** 2), 0)",-0.000653398 SHOPPING - Arrival Constant: Shift for every 30 minutes before 12:00 pm - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'shopping') & (df.end<19)), (np.where ((df.end<19), np.minimum(19-df.end,10), 0) + np.where((df.end>38), np.minimum(df.end-38,5), 0)), 0)",-0.18376635 SHOPPING - Arrival Constant: Before 12:30 PM,@((df.tour_category == 'joint') & (df.tour_type == 'shopping') & (df.end<20)),-0.716195343 SHOPPING - Arrival Constant: 12:30 PM - 03:00 PM,@((df.tour_category == 'joint') & (df.tour_type == 'shopping') & ( df.end>=20) & (df.end<=24)),-0.502714001 @@ -176,7 +176,7 @@ MAINTENANCE - Departure Constant: 10:00 AM - 10:30 AM,@((df.tour_category == 'jo MAINTENANCE - Departure Constant: 10:30 AM - 11:00 AM,@((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.start==16)),-0.427568963 MAINTENANCE - Departure Constant: After 11:00 AM,@((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.start>16)),-0.520863411 MAINTENANCE - Departure Constant: Shift for every 30 minutes after 11:30 am - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.start>17)), np.where((df.start<10), np.minimum(10-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0), 0)",0.042879095 -MAINTENANCE - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.start>17)), ((np.where((df.start<10), np.minimum(10-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)) ** 2), 0)",-0.003157293 +MAINTENANCE - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.start>17)), ((np.where((df.start<10), np.minimum(10-df.start,7), 0) + (np.where((df.start>17), np.minimum(df.start-17,24), 0))).astype(np.int64) ** 2), 0)",-0.003157293 MAINTENANCE - Arrival Constant: Shift for every 30 minutes before 10:00 am - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.end<15)), (np.where((df.end<15), np.minimum(15-df.end,9), 0) + np.where((df.end>28), np.minimum(df.end-28,16), 0)), 0)",-0.226803619 MAINTENANCE - Arrival Constant: Before 10:30 AM,@((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.end<16)),-0.223212258 MAINTENANCE - Arrival Constant: 10:30 AM - 11:00 AM,@((df.tour_category == 'joint') & (df.tour_type == 'othmaint') & (df.end==16)),0 @@ -366,7 +366,9 @@ DISCRETIONARY - Number of auto more that number of adults: Duration > 1.5 hrs - DISCRETIONARY - Kids in Joint Tour: Duration < 1.5 hrs,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othdiscr') & (df.duration<3) & ((df.ptype == 6) | (df.ptype == 7) | (df.ptype == 8))), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0)), 0)",-0.559947083 DISCRETIONARY - Kids in Joint Tour: Duration > 1.5 hr,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othdiscr') & (df.duration>3) & ((df.ptype == 6) | (df.ptype == 7) | (df.ptype == 8))), (np.where((df.duration>3), np.minimum(df.duration-3,47), 0)), 0)",-0.115347031 DISCRETIONARY - Joint Tours Party Size > 2: Duration > 1.5 hr,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othdiscr') & (df.duration>3) & (df.number_of_participants > 2)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0)), 0)",0.104494637 -DISCRETIONARY - Auto Distance: Duration < 1 hrs - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othdiscr') & (df.duration<3) & (df.origin_to_destination_distance)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0)), 0)",-0.162965435 +# FIXME? The following line might be incorrect, it has been modified to avoid a (int & float) operation +# originally: DISCRETIONARY - Auto Distance: Duration < 1 hrs - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othdiscr') & (df.duration<3) & (df.origin_to_destination_distance)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0)), 0)",-0.162965435 +DISCRETIONARY - Auto Distance: Duration < 1 hrs - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othdiscr') & (df.duration<3)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0)) * (df.origin_to_destination_distance), 0)",-0.162965435 DISCRETIONARY - Auto Distance: Duration > 1 hrs - Linear,"@np.where(((df.tour_category == 'joint') & (df.tour_type == 'othdiscr') & (df.duration>3)), (np.where((df.duration>3), np.minimum(df.duration-3,47), 0)) * (df.origin_to_destination_distance), 0)",0.006797399 #The expressions below are for individual tours,, #DISCRETIONARY - Time Pressure - Duration < 1 hr,"@np.where(((df.tour_category != 'joint') & (df.tour_type == 'othdiscr') & (df.duration<3)), np.minimum(3-df.duration,47), 0) * (np.log10 (30 * (tt.remaining_periods_available(df.person_id, df.start, df.end)/(1.0 + df.tour_count - df.tour_num))))",-0.229264474 diff --git a/configs/tour_scheduling_nonmandatory.csv b/configs/tour_scheduling_nonmandatory.csv index 9749a63..15ef83e 100644 --- a/configs/tour_scheduling_nonmandatory.csv +++ b/configs/tour_scheduling_nonmandatory.csv @@ -69,7 +69,7 @@ util_escort_duration_constant_1_hour_30_minutes,ESCORT - Duration Constant: 1.5h util_escort_duration_constant_2_hours,ESCORT - Duration Constant: 2 hrs,@((df.tour_type == 'escort') & (df.duration==4)),coef_escort_duration_constant_2_hours util_escort_duration_constant_longer_than_2_hours,ESCORT - Duration Constant: Longer than 2 hrs,@((df.tour_type == 'escort') & (df.duration>4)),coef_escort_duration_constant_longer_than_2_hours util_escort_calibration_constant_duration_1,ESCORT - Calibration Constant - Duration = 1,@((df.tour_type == 'escort') & (df.duration==0)),coef_escort_calibration_constant_duration_1 -util_escort_calibration_constant_duration_2,ESCORT - Calibration Constant - Duration = 2,@(((df.tour_type == 'escort') & df.duration==1)),coef_escort_calibration_constant_duration_2 +util_escort_calibration_constant_duration_2,ESCORT - Calibration Constant - Duration = 2,@((df.tour_type == 'escort') & (df.duration==1)),coef_escort_calibration_constant_duration_2 util_escort_calibration_constant_departure_9,ESCORT - Calibration Constant - Departure = 9,@((df.tour_type == 'escort') & (df.start==9)),coef_escort_calibration_constant_departure_9 util_escort_calibration_constant_departure_10,ESCORT - Calibration Constant - Departure = 10,@((df.tour_type == 'escort') & (df.start==10)),coef_escort_calibration_constant_departure_10 util_escort_calibration_constant_departure_23,ESCORT - Calibration Constant - Departure = 23,@((df.tour_type == 'escort') & (df.start==23)),coef_escort_calibration_constant_departure_23 @@ -103,7 +103,7 @@ util_shopping_departure_constant_10_am_to_10_30_am,SHOPPING - Departure Constant util_shopping_departure_constant_10_30_am_to_11_00_am,SHOPPING - Departure Constant: 10:30 AM - 11:00 AM,@((df.tour_type == 'shopping') & (df.start==16)),coef_shopping_departure_constant_10_30_am_to_11_00_am util_shopping_departure_constant_after_11_am,SHOPPING - Departure Constant: After 11:00 AM,@((df.tour_type == 'shopping') & (df.start>16)),coef_shopping_departure_constant_after_11_am util_shopping_departure_constant_shift_for_every_30_minutes_after_11_30_am_linear,SHOPPING - Departure Constant: Shift for every 30 minutes after 11:30 am - Linear,"@np.where(((df.tour_type == 'shopping') & (df.start>17)), (np.where((df.start<12), np.minimum(12-df.start,7),0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)), 0)",coef_shopping_departure_constant_shift_for_every_30_minutes_after_11_30_am_linear -util_shopping_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared,SHOPPING - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_type == 'shopping') & (df.start>17)), ((np.where((df.start<12), np.minimum(12-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)) ** 2), 0)",coef_shopping_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared +util_shopping_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared,SHOPPING - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_type == 'shopping') & (df.start>17)), ((np.where((df.start<12), np.minimum(12-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)).astype(np.int64) ** 2), 0)",coef_shopping_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared util_shopping_arrival_constant_shift_for_every_30_minutes_before_12_pm_linear,SHOPPING - Arrival Constant: Shift for every 30 minutes before 12:00 pm - Linear,"@np.where(((df.tour_type == 'shopping') & (df.end<19)), (np.where ((df.end<19), np.minimum(19-df.end,10), 0) + np.where((df.end>38), np.minimum(df.end-38,5), 0)), 0)",coef_shopping_arrival_constant_shift_for_every_30_minutes_before_12_pm_linear util_shopping_arrival_constant_before_12_30_pm,SHOPPING - Arrival Constant: Before 12:30 PM,@((df.tour_type == 'shopping') & (df.end<20)),coef_shopping_arrival_constant_before_12_30_pm util_shopping_arrival_constant_12_30_pm_to_3_pm,SHOPPING - Arrival Constant: 12:30 PM - 03:00 PM,@((df.tour_type == 'shopping') & ( df.end>=20) & (df.end<=24)),coef_shopping_arrival_constant_12_30_pm_to_3_pm @@ -159,7 +159,7 @@ util_maintenance_departure_constant_10_am_to_10_30_am,MAINTENANCE - Departure Co util_maintenance_departure_constant_10_30_am_to_11_am,MAINTENANCE - Departure Constant: 10:30 AM - 11:00 AM,@((df.tour_type == 'othmaint') & (df.start==16)),coef_maintenance_departure_constant_10_30_am_to_11_am util_maintenance_departure_constant_after_11_am,MAINTENANCE - Departure Constant: After 11:00 AM,@((df.tour_type == 'othmaint') & (df.start>16)),coef_maintenance_departure_constant_after_11_am util_maintenance_departure_constant_shift_for_every_30_minutes_after_11_30_am_linear,MAINTENANCE - Departure Constant: Shift for every 30 minutes after 11:30 am - Linear,"@np.where(((df.tour_type == 'othmaint') & (df.start>17)), np.where((df.start<10), np.minimum(10-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0), 0)",coef_maintenance_departure_constant_shift_for_every_30_minutes_after_11_30_am_linear -util_maintenance_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared,MAINTENANCE - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_type == 'othmaint') & (df.start>17)), ((np.where((df.start<10), np.minimum(10-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)) ** 2), 0)",coef_maintenance_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared +util_maintenance_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared,MAINTENANCE - Departure Constant: Shift for every 30 minutes after 11:30 am - Squared,"@np.where(((df.tour_type == 'othmaint') & (df.start>17)), ((np.where((df.start<10), np.minimum(10-df.start,7), 0) + np.where((df.start>17), np.minimum(df.start-17,24), 0)).astype(np.int64) ** 2), 0)",coef_maintenance_departure_constant_shift_for_every_30_minutes_after_11_30_am_squared util_maintenance_arrival_constant_shift_for_every_30_minutes_before_10_am_linear,MAINTENANCE - Arrival Constant: Shift for every 30 minutes before 10:00 am - Linear,"@np.where(((df.tour_type == 'othmaint') & (df.end<15)), (np.where((df.end<15), np.minimum(15-df.end,9), 0) + np.where((df.end>28), np.minimum(df.end-28,16), 0)), 0)",coef_maintenance_arrival_constant_shift_for_every_30_minutes_before_10_am_linear util_maintenance_arrival_constant_before_10_30_am,MAINTENANCE - Arrival Constant: Before 10:30 AM,@((df.tour_type == 'othmaint') & (df.end<16)),coef_maintenance_arrival_constant_before_10_30_am util_maintenance_arrival_constant_10_30_am_to_11_am,MAINTENANCE - Arrival Constant: 10:30 AM - 11:00 AM,@((df.tour_type == 'othmaint') & (df.end==16)),coef_maintenance_arrival_constant_10_30_am_to_11_am @@ -302,7 +302,7 @@ util_discretionary_zero_auto_households_duration_greater_than_1_hr_30_minutes_li util_discretionary_number_of_auto_more_than_number_of_adults_duration_less_than_1_hr_30_minutes_linear,DISCRETIONARY - Number of auto more that number of adults: Duration < 1.5 hrs - Linear,"@np.where(((df.auto_ownership > 0) & (df.tour_type == 'othdiscr') & (df.auto_ownership > df.num_adults) & (df.duration<3)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0) + np.where((df.duration>3), np.minimum(df.duration-3,47), 0)),0)",coef_discretionary_number_of_auto_more_than_number_of_adults_duration_less_than_1_hr_30_minutes_linear util_discretionary_number_of_auto_more_than_number_of_adults_duration_greater_than_1_hr_30_minutes_linear,DISCRETIONARY - Number of auto more that number of adults: Duration > 1.5 hrs - Linear,"@np.where(((df.auto_ownership > 0) &(df.tour_type == 'othdiscr')&(df.auto_ownership > df.num_adults) & (df.duration>3)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0) + np.where((df.duration>3), np.minimum(df.duration-3,47), 0)), 0)",coef_discretionary_number_of_auto_more_than_number_of_adults_duration_greater_than_1_hr_30_minutes_linear "# In CTRAMP, although the description below says duration is less than 1 hr, expression is for less than 1.5 hr",,, -util_discretionary_auto_distance_duration_less_than_1_hr_linear,DISCRETIONARY - Auto Distance: Duration < 1 hr - Linear,"@np.where(((df.tour_type == 'othdiscr') & (df.duration<3) & (df.origin_to_destination_distance)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0) + np.where((df.duration>3), np.minimum(df.duration-3,47), 0)), 0)",coef_discretionary_auto_distance_duration_less_than_1_hr_linear +util_discretionary_auto_distance_duration_less_than_1_hr_linear,DISCRETIONARY - Auto Distance: Duration < 1 hr - Linear,"@np.where((((df.tour_type == 'othdiscr') & (df.duration<3)) * (df.origin_to_destination_distance)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0) + np.where((df.duration>3), np.minimum(df.duration-3,47), 0)), 0)",coef_discretionary_auto_distance_duration_less_than_1_hr_linear util_discretionary_auto_distance_duration_greater_than_1_hr_linear,DISCRETIONARY - Auto Distance: Duration > 1 hr - Linear,"@np.where(((df.tour_type == 'othdiscr') & (df.duration>3)), (np.where((df.duration<=3), np.minimum(3-df.duration,47), 0) + np.where((df.duration>3), np.minimum(df.duration-3,47), 0)) * (df.origin_to_destination_distance), 0)",coef_discretionary_auto_distance_duration_greater_than_1_hr_linear util_discretionary_time_pressure_duration_less_than_1_hr,DISCRETIONARY - Time Pressure - Duration < 1 hr,"@np.where(((df.tour_category != 'joint') & (df.tour_type == 'othdiscr') & (df.duration<3)), np.minimum(3-df.duration,47), 0) * (np.log10 (30 * (tt.remaining_periods_available(df.person_id, df.start, df.end)/(1.0 + df.tour_count - df.tour_num))))",coef_discretionary_time_pressure_duration_less_than_1_hr util_discretionary_time_pressure_duration_greater_than_1_hr,DISCRETIONARY - Time Pressure - Duration > 1 hr,"@np.where(((df.tour_category != 'joint') & (df.tour_type == 'othdiscr') & (df.duration>3)), np.minimum(df.duration-3,47) * (np.log10 (30 * (tt.remaining_periods_available(df.person_id, df.start, df.end)/(1.0 + df.tour_count - df.tour_num)))), 0)",coef_discretionary_time_pressure_duration_greater_than_1_hr diff --git a/configs/trip_mode_choice.csv b/configs/trip_mode_choice.csv index 18ea3c3..2ba519f 100644 --- a/configs/trip_mode_choice.csv +++ b/configs/trip_mode_choice.csv @@ -178,8 +178,8 @@ KNRPRM Inbound - Drive time,@df.inbound * c_knrTime * (dot_skims['WLK_PRMTRN_KNR KNRPRM Inbound - Cost,@df.inbound * df.c_cost*(dot_skims['WLK_PRMTRN_KNR_FARE']*100+(dot_skims['WLK_PRMTRN_KNR_AUTO']*20/60*costPerMile))*(df.knr_prmTransit_available_in) * (c_filter_atwrk == 0),,,,,,,,,,,,,,1, #,,,,,,,,,,,,,,,, #SCHOOL,,,,,,,,,,,,,,,, -SCHOOL - Grade school pre-driver,"@np.where(df.school_mode_available & df.age<16, 1, 0) * 2.9620 * (c_filter_atwrk == 0) * (c_filter_sch == 1)",,,,,,,,,,,,,,,1 -SCHOOL - Grade school driver,"@np.where(df.school_mode_available & df.age>15, 1, 0) * 0.1473 * (c_filter_atwrk == 0) * (c_filter_sch == 1)",,,,,,,,,,,,,,,1 +SCHOOL - Grade school pre-driver,"@np.where(df.school_mode_available & (df.age<16), 1, 0) * 2.9620 * (c_filter_atwrk == 0) * (c_filter_sch == 1)",,,,,,,,,,,,,,,1 +SCHOOL - Grade school driver,"@np.where(df.school_mode_available & (df.age>15), 1, 0) * 0.1473 * (c_filter_atwrk == 0) * (c_filter_sch == 1)",,,,,,,,,,,,,,,1 SCHOOL - Rural/exurban destination,"@np.where(df.school_mode_available & df.ruralDestination, 1, 0) * 1.3400 * (c_filter_atwrk == 0) * (c_filter_sch == 1)",,,,,,,,,,,,,,,1 SCHOOL - O/d distance greater than 10 miles,"@np.where((df.school_mode_available) & (odt_skims['SOV_FREE_DISTANCE']>10) , 1, 0) * (-2.372) * (c_filter_atwrk == 0) * (c_filter_sch == 1)",,,,,,,,,,,,,,,1 SCHOOL - Depart from home before 8 am,"@np.where((df.school_mode_available) & (df.time_out_school) , 1, 0) * 0.5960 * (c_filter_atwrk == 0) * (c_filter_sch == 1)",,,,,,,,,,,,,,,1 From 32b04c0d678dc2e9a1ace370b223594db88fa3c0 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Thu, 25 Jul 2024 10:23:35 -0400 Subject: [PATCH 09/19] correct non mand tour freq spec --- configs/non_mandatory_tour_frequency.csv | 2 +- ...n_mandatory_tour_frequency_annotate_persons_preprocessor.csv | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/non_mandatory_tour_frequency.csv b/configs/non_mandatory_tour_frequency.csv index 36da94f..7e691af 100644 --- a/configs/non_mandatory_tour_frequency.csv +++ b/configs/non_mandatory_tour_frequency.csv @@ -139,7 +139,7 @@ util_presence_of_university_student_and_maintenance_tour,Dummy for Presence of U 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 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 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 -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 +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 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 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 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 diff --git a/configs/non_mandatory_tour_frequency_annotate_persons_preprocessor.csv b/configs/non_mandatory_tour_frequency_annotate_persons_preprocessor.csv index baabbc5..5b15a51 100644 --- a/configs/non_mandatory_tour_frequency_annotate_persons_preprocessor.csv +++ b/configs/non_mandatory_tour_frequency_annotate_persons_preprocessor.csv @@ -29,3 +29,5 @@ presence of retiree other than self in household,has_retiree,"other_than(persons presence of driving_kid other than self in household,has_driving_kid,"other_than(persons.household_id, persons.ptype == 6)" presence of school_kid other than self in household,has_school_kid,"other_than(persons.household_id, persons.ptype == 7)" presence of preschooler other than self in household,has_preschool_kid,"other_than(persons.household_id, persons.ptype == 8)" +presence of at home school_kid other than self in household,has_school_kid_at_home,"other_than(persons.household_id, (persons.ptype == 7)&(~persons.travel_active))" +presence of at home preschooler other than self in household,has_preschool_kid_at_home,"other_than(persons.household_id, (persons.ptype == 8)&(~persons.travel_active))" \ No newline at end of file From 8c91dfc27c73814310636e282f5a6e3ed58038c1 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Fri, 26 Jul 2024 16:46:09 -0400 Subject: [PATCH 10/19] trip destination sharrow spec --- configs/trip_destination.csv | 4 ++-- configs/trip_destination_annotate_trips_preprocessor.csv | 2 ++ configs/trip_destination_sample.csv | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configs/trip_destination.csv b/configs/trip_destination.csv index dc92ce8..4d93bc2 100644 --- a/configs/trip_destination.csv +++ b/configs/trip_destination.csv @@ -8,8 +8,8 @@ All - Tour origin zone,@(df.origin == df.dest_zone_id),0.7112,0.7112,0.7112,0.71 All - Tour destinatoin zone,@(df.destination == df.dest_zone_id),1.037,1.037,1.037,1.037,1.037,1.037,1.037,1.037,1.037,1.037 "# dest_zone_id is not available in the preprocessor file and reindex is not available here, so the expression was commented out. Similar expression was commented out in the ActivitySim example file as well. ",,,,,,,,,,, # All - CBD area type,"@reindex(land_use.areatype, df.dest_zone_id) == 1",-0.285,-0.285,-0.285,-0.285,-0.285,-0.285,-0.285,-0.285,-0.285,-0.285 -All - Size variable ,"@np.log1p(size_terms.get(df.dest_zone_id, df.purpose))",1,1,1,1,1,1,1,1,1,1 -All - No attractions,"@size_terms.get(df.dest_zone_id, df.purpose) == 0",-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 +All - Size variable ,"@np.log1p(size_terms.get(df.dest_zone_id, df.purpose)) # sharrow: np.log1p(size_terms['sizearray'])",1,1,1,1,1,1,1,1,1,1 +All - No attractions,"@size_terms.get(df.dest_zone_id, df.purpose) == 0 # sharrow: size_terms['sizearray'] == 0",-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 #Applied the conventions used in the destination sample file,,,,,,,,,,, ,"_org_to_stop_dist@od_skims[('SOV_FREE_DISTANCE', 'MD')]",1,1,1,1,1,1,1,1,1,1 ,"_stop_to_dest_dist@dp_skims[('SOV_FREE_DISTANCE', 'MD')]",1,1,1,1,1,1,1,1,1,1 diff --git a/configs/trip_destination_annotate_trips_preprocessor.csv b/configs/trip_destination_annotate_trips_preprocessor.csv index 1ba3afb..c740b72 100644 --- a/configs/trip_destination_annotate_trips_preprocessor.csv +++ b/configs/trip_destination_annotate_trips_preprocessor.csv @@ -10,3 +10,5 @@ Description,Target,Expression #,,not needed as school is not chosen as an intermediate trip destination #,_grade_school,"(df.primary_purpose == 'school') & reindex(persons.is_gradeschool, df.person_id)" #,size_segment,"df.primary_purpose.where(df.primary_purpose != 'school', np.where(_grade_school,'gradeschool', 'highschool'))" +,tour_leg_dest,"np.where(df.outbound,reindex(tours.destination, df.tour_id), reindex(tours.origin, df.tour_id))" +,purpose_index_num,"size_terms.get_cols(df.purpose)" \ No newline at end of file diff --git a/configs/trip_destination_sample.csv b/configs/trip_destination_sample.csv index 63b0031..c41acb9 100644 --- a/configs/trip_destination_sample.csv +++ b/configs/trip_destination_sample.csv @@ -13,5 +13,5 @@ not available if walk tour not within walking distance,@(df.tour_mode=='WALK') & not available if bike tour not within biking distance,@(df.tour_mode=='BIKE') & (odt_skims['SOV_FREE_DISTANCE'] > max_bike_distance),-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 not available if bike tour not within biking distance,@(df.tour_mode=='BIKE') & (dpt_skims['SOV_FREE_DISTANCE'] > max_bike_distance),-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 "stop not available if tourMode is transit, and stop isn't walkable or accessible by transit","@np.where((((df.tour_mode=='WALK_ALLTRN')|(df.tour_mode=='WALK_PRMTRN')) & (((_od_AllIVT > 0) & (_od_DIST > 3) & (_dp_AllIVT > 0) & (_dp_DIST > 3)) | ((_od_AllIVT > 0) & (_od_DIST > 3) & (_dp_AllIVT > 0) & (_dp_DIST > 3)))), 1, 0)",-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 -Size variable ,"@np.log1p(size_terms.get(df.dest_zone_id, df.purpose))",1,1,1,1,1,1,1,1,1,1 -No attractions,"@np.where(size_terms.get(df.dest_zone_id, df.purpose) == 0, 1, 0)",-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 +Size variable ,"@np.log1p(size_terms.get(df.dest_zone_id, df.purpose)) # sharrow: np.log1p(size_terms['sizearray'])",1,1,1,1,1,1,1,1,1,1 +No attractions,"@np.where(size_terms.get(df.dest_zone_id, df.purpose) == 0, 1, 0) # sharrow: size_terms['sizearray'] == 0",-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 From 3b22eb234537e69d26b2fddc953e0d8f7c713390 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Mon, 29 Jul 2024 13:49:02 -0400 Subject: [PATCH 11/19] sharrow compile settings --- configs_sh_compile/settings_sh.yaml | 208 ++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 configs_sh_compile/settings_sh.yaml diff --git a/configs_sh_compile/settings_sh.yaml b/configs_sh_compile/settings_sh.yaml new file mode 100644 index 0000000..be317f0 --- /dev/null +++ b/configs_sh_compile/settings_sh.yaml @@ -0,0 +1,208 @@ +households_sample_size: 1000 + +# input tables +input_table_list: + - tablename: households + filename: households.csv + # The index column is set before keep_columns, + # so don't put index in keep columns + index_col: household_id + recode_columns: + home_zone_id: land_use.zone_id + rename_columns: + maz: home_zone_id + np: hhsize + nwrkrs_esr: num_workers + keep_columns: + - home_zone_id + - hhsize + - num_workers + - hincp + - hht + - tablename: persons + filename: persons.csv + # The index column is set before keep_columns, + # so don't put index in keep columns + index_col: person_id + rename_columns: + maz: home_zone_id + sporder: PNUM + keep_columns: + - household_id + - home_zone_id + - PNUM + - agep + - pecasOcc + - sex + - esr + - wkw + - wkhp + - schg + - tablename: land_use + filename: land_use.csv + # The index column is set before keep_columns, + # so don't put index in keep columns + index_col: zone_id + recode_columns: + zone_id: zero-based + keep_columns: + - retail + - service + - emp + - pop + - hshld + - univ + - acres + - PARKTOT + - PARKLNG + - PROPFREE + - PARKRATE + - areatype + - CBDFlag + - N11 + - N21 + - N22 + - N23 + - N313233 + - N42 + - N4445 + - N4849 + - N51 + - N52 + - N53 + - N54 + - N55 + - N56 + - N61 + - N62 + - N71 + - N72 + - N81 + - N92 + - EnrollDS + - EnrollPD + - I_PCTLT10K + - I_PCT10TO20 + - I_PCT20TO40 + - I_PCTGT40 + - RetailEmp30 + - PARKING_ZONE + +#input data store and skims +#input_store: arc_asim.h5 +skims_file: skims.omx + +# - shadow pricing global switches + +# turn shadow_pricing on and off for all models (e.g. school and work) +# shadow pricing is deprecated for less than full samples +use_shadow_pricing: True + +# chunk_size: +chunk_method: hybrid_uss +chunk_training_mode: explicit + +models: + - initialize_landuse + - compute_accessibility + - initialize_households + - school_location + - workplace_location + - auto_ownership_simulate + - free_parking + - cdap_simulate + - mandatory_tour_frequency + - mandatory_tour_scheduling + - joint_tour_frequency + - joint_tour_composition + - joint_tour_participation + - joint_tour_destination + - joint_tour_scheduling + - non_mandatory_tour_frequency + - non_mandatory_tour_destination + - non_mandatory_tour_scheduling + - tour_mode_choice_simulate + - atwork_subtour_frequency + - atwork_subtour_destination + - atwork_subtour_scheduling + - atwork_subtour_mode_choice + - stop_frequency + - trip_purpose + - trip_destination + - trip_purpose_and_destination + - trip_scheduling_choice + - trip_departure_choice + - trip_mode_choice + - parking_location + - write_data_dictionary + - track_skim_usage + - write_trip_matrices + - write_tables + +resume_after: trip_departure_choice + +multiprocess: False +fail_fast: True +num_processes: 28 + +multiprocess_steps: + - name: mp_initialize_landuse + begin: initialize_landuse + - name: mp_accessibility + begin: compute_accessibility + slice: + tables: + - accessibility + - name: mp_initialize_households + begin: initialize_households + - name: mp_households + begin: school_location + slice: + tables: + - households + - persons + - name: mp_summarize + begin: write_trip_matrices + + +output_tables: + h5_store: False + action: include + prefix: final_ + tables: + - checkpoints + - accessibility + - tablename: land_use + decode_columns: + zone_id: land_use.zone_id + - tablename: households + decode_columns: + home_zone_id: land_use.zone_id + - tablename: persons + decode_columns: + home_zone_id: land_use.zone_id + school_zone_id: nonnegative | land_use.zone_id + workplace_zone_id: nonnegative | land_use.zone_id + - tablename: tours + decode_columns: + origin: land_use.zone_id + destination: land_use.zone_id + - tablename: trips + decode_columns: + origin: land_use.zone_id + destination: land_use.zone_id + - joint_tour_participants + +# trace_od: [100,10] +# trace_hh_id: 292105 #2720 +# trace_hh_id: 2 +# trace_hh_id: 1643904 + +min_value_of_time: 1 +max_value_of_time: 50 +distributed_vot_mu: 0.684 +distributed_vot_sigma: 0.85 + +# when running sharrow +sharrow: test +recode_pipeline_columns: True \ No newline at end of file From 21e8ca1423a18c96260aedcbb6d7fe1019e7d99e Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Thu, 1 Aug 2024 14:37:55 -0500 Subject: [PATCH 12/19] ignore data files --- data/.gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/.gitignore diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..8bc6907 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,3 @@ +*.csv +*.omx +*.zip From 5d95f6d28d73760231cf241edf7fed0c96726021 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Sun, 4 Aug 2024 18:22:40 -0500 Subject: [PATCH 13/19] update logging instructions --- configs/logging.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configs/logging.yaml b/configs/logging.yaml index 3b1bfdd..3c20ffe 100644 --- a/configs/logging.yaml +++ b/configs/logging.yaml @@ -24,6 +24,15 @@ logging: handlers: [console, logfile] propagate: false + black: + # sharrow uses black to reformat code, but we don't generally care + # about messages emitted by black unless they are serious + level: WARN + + blib2to3: + # this is a vendored library within black that we also want to squelch + level: WARN + handlers: logfile: @@ -37,7 +46,7 @@ logging: console: class: logging.StreamHandler stream: ext://sys.stdout - formatter: simpleFormatter + formatter: elapsedFormatter level: NOTSET formatters: @@ -53,3 +62,7 @@ logging: format: '%(asctime)s - %(levelname)s - %(name)s - %(message)s' datefmt: '%d/%m/%Y %H:%M:%S' + elapsedFormatter: + (): activitysim.core.tracing.ElapsedTimeFormatter + format: '[{elapsedTime}] {levelname:s}: {message:s}' + style: '{' From 1852f8a42fdaf9d639dea6e208c2331c4dcf4c6d Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Sun, 4 Aug 2024 18:23:24 -0500 Subject: [PATCH 14/19] handle recoding --- configs/settings.yaml | 4 ++-- ...top_frequency_annotate_tours_preprocessor.csv | 2 +- configs/trip_mode_choice.csv | 16 ++++++++-------- ...p_mode_choice_annotate_trips_preprocessor.csv | 6 ++++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/configs/settings.yaml b/configs/settings.yaml index 785c376..d497f39 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -56,8 +56,8 @@ input_table_list: # The index column is set before keep_columns, # so don't put index in keep columns index_col: zone_id -# rename_columns: -# + recode_columns: + zone_id: zero-based keep_columns: #- TAZ # - construc diff --git a/configs/stop_frequency_annotate_tours_preprocessor.csv b/configs/stop_frequency_annotate_tours_preprocessor.csv index 4f901d6..3533588 100644 --- a/configs/stop_frequency_annotate_tours_preprocessor.csv +++ b/configs/stop_frequency_annotate_tours_preprocessor.csv @@ -33,7 +33,7 @@ Number of subtours in the tour,num_atwork_subtours,"df.atwork_subtour_frequency. #,, Number of hh shop tours including joint,num_hh_shop_tours,"reindex_i(df[df.tour_type==SHOP_TOUR].groupby('household_id').size(), df.person_id)" Number of hh maint tours including joint,num_hh_maint_tours,"reindex_i(df[df.tour_type==MAINT_TOUR].groupby('household_id').size(), df.person_id)" -tourStartsInPeakPeriod,_tour_starts_in_peak,(network_los.skim_time_period_label(df.start) == 'AM') | (network_los.skim_time_period_label(df.start) == 'PM') +tourStartsInPeakPeriod,_tour_starts_in_peak,(network_los.skim_time_period_label(df.start) == 'AM') | (network_los.skim_time_period_label(df.start) == 'PM') | (network_los.skim_time_period_label(df.start) == 1) | (network_los.skim_time_period_label(df.start) == 3) AccesibilityAtOrigin fallback,hhacc,0 AccesibilityAtOrigin if transit,hhacc,"hhacc.where(~tour_mode_is_transit, df.trPkRetail.where(_tour_starts_in_peak, df.trOpRetail))" AccesibilityAtOrigin if non_motorized,hhacc,"hhacc.where(~tour_mode_is_non_motorized, df.nmRetail)" diff --git a/configs/trip_mode_choice.csv b/configs/trip_mode_choice.csv index 2ba519f..556b0b0 100644 --- a/configs/trip_mode_choice.csv +++ b/configs/trip_mode_choice.csv @@ -196,14 +196,14 @@ PAYMODE - Constants,"@np.where((c_filter_atwrk == 0), (c_ivt)*(pay_md_cons), 0)" #MARTA Constants,,,,,,,,,,,,,,,, MARTA CONSTANT - Walk All Transit,"@c_ivt*np.minimum(odt_skims['WLK_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)",,,,,,,,,1,,,,,, MARTA CONSTANT - Walk Premium,"@c_ivt*np.minimum(odt_skims['WLK_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)",,,,,,,,,,1,,,,, -MARTA CONSTANT - PNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,, -MARTA CONSTANT - PNR All Transit - Inbound Leg of Tour,"@df.inbound *c_ivt*np.minimum(dot_skims['WLK_ALLTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,, -MARTA CONSTANT - PNR Premium - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,, -MARTA CONSTANT - PNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,, -MARTA CONSTANT - KNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['KNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,, -MARTA CONSTANT - KNR All Transit - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_ALLTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,, -MARTA CONSTANT - KNR Premium - Outbound Leg of Tour,"@df.outbound * c_ivt*np.minimum(odt_skims['KNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1, -MARTA CONSTANT - KNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1, +MARTA CONSTANT - PNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,, +MARTA CONSTANT - PNR All Transit - Inbound Leg of Tour,"@df.inbound *c_ivt*np.minimum(dot_skims['WLK_ALLTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,, +MARTA CONSTANT - PNR Premium - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,, +MARTA CONSTANT - PNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,, +MARTA CONSTANT - KNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['KNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,, +MARTA CONSTANT - KNR All Transit - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_ALLTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,, +MARTA CONSTANT - KNR Premium - Outbound Leg of Tour,"@df.outbound * c_ivt*np.minimum(odt_skims['KNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1, +MARTA CONSTANT - KNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1, #,,,,,,,,,,,,,,,, Walk Transit Short Distance Disutility,"@c_ivt*np.minimum(np.maximum((-3*odt_skims['SOV_FREE_DISTANCE']+40),0),30)",,,,,,,,,1,1,,,,, #,,,,,,,,,,,,,,,, diff --git a/configs/trip_mode_choice_annotate_trips_preprocessor.csv b/configs/trip_mode_choice_annotate_trips_preprocessor.csv index 3e55f25..ce0109b 100644 --- a/configs/trip_mode_choice_annotate_trips_preprocessor.csv +++ b/configs/trip_mode_choice_annotate_trips_preprocessor.csv @@ -13,8 +13,10 @@ free parking availability,free_parking_available,(df.tour_type == 'work') & df.f #cost coefficients,, ,c_cost,(c_cost_low * df.is_low_income)+(c_cost_med * df.is_medium_income)+(c_cost_high * df.is_high_income)+(c_cost_high * df.is_very_high_income) #,, -is_morning_period,_out_period,"(df.trip_period.isin(['EA','AM','MD']))" -is_afternoon_period,_in_period,"(df.trip_period.isin(['MD','PM']))" +is_morning_period,_out_period,"(df.trip_period.isin(['EA','AM','MD', 0, 1, 2]))" +is_afternoon_period,_in_period,"(df.trip_period.isin(['MD','PM', 2, 3]))" +,is_out_period,_out_period +,is_in_period,_in_period #,, WLKALL transit in-vehicle time - outbound direction,walk_allTransit_ivt,odt_skims['WLK_ALLTRN_WLK_LOCAL']+expr*odt_skims['WLK_ALLTRN_WLK_XBUS']+hrt*odt_skims['WLK_ALLTRN_WLK_HRT']+brt*odt_skims['WLK_ALLTRN_WLK_BRT']+lrt*odt_skims['WLK_ALLTRN_WLK_LRT']+crl*odt_skims['WLK_ALLTRN_WLK_COMRAIL'] WLKPRM transit in-vehicle time - outbound direction,walk_prmTransit_ivt,odt_skims['WLK_PRMTRN_WLK_LOCAL']+expr*odt_skims['WLK_PRMTRN_WLK_XBUS']+hrt*odt_skims['WLK_PRMTRN_WLK_HRT']+brt*odt_skims['WLK_PRMTRN_WLK_BRT']+lrt*odt_skims['WLK_PRMTRN_WLK_LRT']+crl*odt_skims['WLK_PRMTRN_WLK_COMRAIL'] From e988b32c9511c37ceae77f4f00927d5f16588282 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Mon, 5 Aug 2024 11:00:53 -0500 Subject: [PATCH 15/19] recode hh home zone --- configs/settings.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/settings.yaml b/configs/settings.yaml index d497f39..20206d4 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -11,6 +11,8 @@ input_table_list: maz: home_zone_id np: hhsize nwrkrs_esr: num_workers + recode_columns: + home_zone_id: land_use.zone_id keep_columns: #- household_id - home_zone_id From a1d9a402fa16f77af6804e46a608607affb1a689 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Mon, 5 Aug 2024 11:19:58 -0500 Subject: [PATCH 16/19] output decoding --- configs/settings.yaml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/configs/settings.yaml b/configs/settings.yaml index 20206d4..8ed7275 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -200,11 +200,26 @@ output_tables: tables: - checkpoints - accessibility - - land_use - - households - - persons - - tours - - trips + - tablename: land_use + decode_columns: + zone_id: land_use.zone_id + - tablename: households + decode_columns: + home_zone_id: land_use.zone_id + - tablename: persons + decode_columns: + home_zone_id: land_use.zone_id + school_zone_id: nonnegative | land_use.zone_id + workplace_zone_id: nonnegative | land_use.zone_id + - tablename: tours + decode_columns: + origin: land_use.zone_id + destination: land_use.zone_id + - tablename: trips + decode_columns: + origin: land_use.zone_id + destination: land_use.zone_id + parking_zone_id: nonnegative | land_use.zone_id - joint_tour_participants # trace_od: [100,10] From 57aa83725659bb66a8daabad91078823871239ac Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Mon, 19 Aug 2024 10:07:19 -0400 Subject: [PATCH 17/19] config cleaning --- configs/settings.yaml | 34 +--- configs/settings_mp.yaml | 230 ---------------------------- configs/trip_mode_choice.yaml | 5 + configs_sh_compile/settings_sh.yaml | 3 +- 4 files changed, 12 insertions(+), 260 deletions(-) delete mode 100644 configs/settings_mp.yaml diff --git a/configs/settings.yaml b/configs/settings.yaml index 8ed7275..637850d 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -14,17 +14,11 @@ input_table_list: recode_columns: home_zone_id: land_use.zone_id keep_columns: - #- household_id - home_zone_id - hhsize - num_workers - hincp - #- hhincAdj - #- adjinc - #- veh - hht - #- bld - #- type - tablename: persons filename: persons.csv # The index column is set before keep_columns, @@ -34,25 +28,16 @@ input_table_list: maz: home_zone_id sporder: PNUM keep_columns: - #- person_id - household_id - home_zone_id - PNUM - agep - #- employed - pecasOcc - sex - esr - wkw - wkhp - #-mil - schg - #-schl - #-indp02 - #-indp07 - #-occp02 - #-occp10 - #-n - tablename: land_use filename: land_use.csv # The index column is set before keep_columns, @@ -61,29 +46,18 @@ input_table_list: recode_columns: zone_id: zero-based keep_columns: - #- TAZ -# - construc -# - manufac -# - TCU -# - wholesl - retail -# - FIRE - service -# - private -# - govt - emp - pop - hshld - univ - acres -# - otherEmp -# - district - PARKTOT - PARKLNG - PROPFREE - PARKRATE - areatype -# - county - CBDFlag - N11 - N21 @@ -169,13 +143,13 @@ models: multiprocess: True fail_fast: True +num_processes: 28 multiprocess_steps: - name: mp_initialize_landuse begin: initialize_landuse - name: mp_accessibility begin: compute_accessibility - num_processes: 28 slice: tables: - accessibility @@ -183,8 +157,6 @@ multiprocess_steps: begin: initialize_households - name: mp_households begin: school_location - num_processes: 28 - # chunk_size: 300000000 slice: tables: - households @@ -231,3 +203,7 @@ min_value_of_time: 1 max_value_of_time: 50 distributed_vot_mu: 0.684 distributed_vot_sigma: 0.85 + +# when running sharrow +sharrow: require +recode_pipeline_columns: True \ No newline at end of file diff --git a/configs/settings_mp.yaml b/configs/settings_mp.yaml deleted file mode 100644 index ff4a066..0000000 --- a/configs/settings_mp.yaml +++ /dev/null @@ -1,230 +0,0 @@ -# input tables -input_table_list: - - tablename: households - filename: households.csv - # The index column is set before keep_columns, - # so don't put index in keep columns - index_col: household_id - rename_columns: - maz: zone_id - np: hhsize - nwrkrs_esr: num_workers - keep_columns: - #- household_id - - zone_id - - hhsize - - num_workers - - hincp - #- hhincAdj - #- adjinc - #- veh - - hht - #- bld - #- type - - tablename: persons - filename: persons.csv - # The index column is set before keep_columns, - # so don't put index in keep columns - index_col: person_id - rename_columns: - maz: zone_id - sporder: PNUM - keep_columns: - #- person_id - - household_id - - zone_id - - PNUM - - agep - #- employed - - pecasOcc - - sex - - esr - - wkw - - wkhp - #-mil - - schg - #-schl - #-indp02 - #-indp07 - #-occp02 - #-occp10 - #-n - - tablename: land_use - filename: land_use.csv - # The index column is set before keep_columns, - # so don't put index in keep columns - index_col: zone_id -# rename_columns: -# - keep_columns: - #- TAZ -# - construc -# - manufac -# - TCU -# - wholesl - - retail -# - FIRE - - service -# - private -# - govt - - emp - - pop - - hshld - - univ - - acres -# - otherEmp -# - district - - PARKTOT - - PARKLNG - - PROPFREE - - PARKRATE - - areatype -# - county - - CBDFlag - - N11 - - N21 - - N22 - - N23 - - N313233 - - N42 - - N4445 - - N4849 - - N51 - - N52 - - N53 - - N54 - - N55 - - N56 - - N61 - - N62 - - N71 - - N72 - - N81 - - N92 - - EnrollDS - - EnrollPD - - I_PCTLT10K - - I_PCT10TO20 - - I_PCT20TO40 - - I_PCTGT40 - - RetailEmp30 - -#input data store and skims -#input_store: arc_asim.h5 -skims_file: skims.omx - -# - shadow pricing global switches - -# turn shadow_pricing on and off for all models (e.g. school and work) -# shadow pricing is deprecated for less than full samples -use_shadow_pricing: True - -#trace_od: [100,10] -# 309462, 390302 -trace_hh_id: 333650 -#trace_hh_id: 2 -#trace_hh_id: 1643904 - -# chunk_size: 300000000 - -models: - - initialize_landuse - - compute_accessibility - - initialize_households - - school_location - - workplace_location - - auto_ownership_simulate - - free_parking - - cdap_simulate - - mandatory_tour_frequency - - mandatory_tour_scheduling - - joint_tour_frequency - - joint_tour_composition - - joint_tour_participation - - joint_tour_destination - - joint_tour_scheduling - - non_mandatory_tour_frequency - - non_mandatory_tour_destination - - non_mandatory_tour_scheduling - - tour_mode_choice_simulate - - atwork_subtour_frequency - - atwork_subtour_destination - - atwork_subtour_scheduling - - atwork_subtour_mode_choice - - stop_frequency - - trip_purpose - - trip_destination - - trip_purpose_and_destination - - trip_scheduling_choice - - trip_departure_choice - - trip_mode_choice - - parking_location -# - write_data_dictionary -# - track_skim_usage -# - write_trip_matrices - - write_tables - -#resume_after: trip_mode_choice - -multiprocess: True -fail_fast: True - -multiprocess_steps: - - name: mp_initialize_landuse - begin: initialize_landuse - - name: mp_accessibility - begin: compute_accessibility - num_processes: 40 - slice: - tables: - - accessibility - - name: mp_initialize_households - begin: initialize_households - - name: mp_households - begin: school_location - num_processes: 40 - #chunk_size: 1000000000 - slice: - tables: - - households - - persons - - name: mp_summarize - begin: write_tables - -output_tables: - h5_store: False - action: include - prefix: final_ - tables: - - checkpoints - - accessibility - - land_use - - households - - persons - - tours - - trips - - joint_tour_participants - - -skim_time_periods: - period_minutes: 30 - periods: - - 0 - - 6 - - 12 - - 20 - - 30 - - 38 - - 48 - labels: - - EV - - EA - - AM - - MD - - PM - - EV - -min_value_of_time: 1 -max_value_of_time: 50 -distributed_vot_mu: 0.684 -distributed_vot_sigma: 0.85 diff --git a/configs/trip_mode_choice.yaml b/configs/trip_mode_choice.yaml index e97f780..87a244b 100644 --- a/configs/trip_mode_choice.yaml +++ b/configs/trip_mode_choice.yaml @@ -143,3 +143,8 @@ REDUNDANT_TOURS_MERGED_CHOOSER_COLUMNS: - number_of_participants MODE_CHOICE_LOGSUM_COLUMN_NAME: mode_choice_logsum + +compute_settings: + protect_columns: + - household_id + - person_id \ No newline at end of file diff --git a/configs_sh_compile/settings_sh.yaml b/configs_sh_compile/settings_sh.yaml index be317f0..333ddb0 100644 --- a/configs_sh_compile/settings_sh.yaml +++ b/configs_sh_compile/settings_sh.yaml @@ -139,7 +139,7 @@ models: - write_trip_matrices - write_tables -resume_after: trip_departure_choice +# resume_after: trip_departure_choice multiprocess: False fail_fast: True @@ -191,6 +191,7 @@ output_tables: decode_columns: origin: land_use.zone_id destination: land_use.zone_id + parking_zone_id: nonnegative | land_use.zone_id - joint_tour_participants # trace_od: [100,10] From 00977c6d555d1a910149c70d0d7791f8a32c60e3 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Mon, 19 Aug 2024 16:28:16 -0400 Subject: [PATCH 18/19] do not slice land use for accessibility mp --- configs/settings.yaml | 8 +++++--- configs_sh_compile/settings_sh.yaml | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configs/settings.yaml b/configs/settings.yaml index 637850d..63450f8 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -153,6 +153,7 @@ multiprocess_steps: slice: tables: - accessibility + exclude: True - name: mp_initialize_households begin: initialize_households - name: mp_households @@ -204,6 +205,7 @@ max_value_of_time: 50 distributed_vot_mu: 0.684 distributed_vot_sigma: 0.85 -# when running sharrow -sharrow: require -recode_pipeline_columns: True \ No newline at end of file +# sharrow settings +# sharrow: require +# recode_pipeline_columns: True +# sharrow_cache_dir: # specify only when not using default \ No newline at end of file diff --git a/configs_sh_compile/settings_sh.yaml b/configs_sh_compile/settings_sh.yaml index 333ddb0..6ff0d9a 100644 --- a/configs_sh_compile/settings_sh.yaml +++ b/configs_sh_compile/settings_sh.yaml @@ -153,6 +153,7 @@ multiprocess_steps: slice: tables: - accessibility + exclude: True - name: mp_initialize_households begin: initialize_households - name: mp_households From 59cd7d38ffc0bc599e2fe54a9a45a4700c3e14c8 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Wed, 21 Aug 2024 11:10:56 -0400 Subject: [PATCH 19/19] fix trip destination choice od skim --- configs/trip_destination.csv | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configs/trip_destination.csv b/configs/trip_destination.csv index 4d93bc2..6ca461e 100644 --- a/configs/trip_destination.csv +++ b/configs/trip_destination.csv @@ -13,9 +13,7 @@ All - No attractions,"@size_terms.get(df.dest_zone_id, df.purpose) == 0 # sharro #Applied the conventions used in the destination sample file,,,,,,,,,,, ,"_org_to_stop_dist@od_skims[('SOV_FREE_DISTANCE', 'MD')]",1,1,1,1,1,1,1,1,1,1 ,"_stop_to_dest_dist@dp_skims[('SOV_FREE_DISTANCE', 'MD')]",1,1,1,1,1,1,1,1,1,1 -# THIS IS WRONG ***** RIGHT HERE **** I CHANGED THE BELOW TO MAKE WORK MECHANICALLY ,,,,,,,,,,, -# ,"_od_distance@op_skims[('SOV_FREE_DISTANCE', 'MD')]",1,1,1,1,1,1,1,1,1,1 -,"_od_distance@od_skims[('SOV_FREE_DISTANCE', 'MD')]",1,1,1,1,1,1,1,1,1,1 +,"_od_distance@op_skims[('SOV_FREE_DISTANCE', 'MD')]",1,1,1,1,1,1,1,1,1,1 #WORK,,,,,,,,,,, WORK - Distance squared,"@((od_skims[('SOV_FREE_DISTANCE', 'MD')] + dp_skims[('SOV_FREE_DISTANCE', 'MD')]) ** 2)",0.0026,,,,,,,,, WORK - Distance cubed,"@((od_skims[('SOV_FREE_DISTANCE', 'MD')] + dp_skims[('SOV_FREE_DISTANCE', 'MD')]) ** 3)",-0.0000109,,,,,,,,,