From 0630659b71df02d1e16cc643dbf1c9cf8c56282a Mon Sep 17 00:00:00 2001 From: David Hensle Date: Fri, 15 Dec 2023 17:02:59 -0800 Subject: [PATCH 1/3] landuse and reindex in loc choice --- activitysim/abm/models/location_choice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/activitysim/abm/models/location_choice.py b/activitysim/abm/models/location_choice.py index 937721c05..8ef502d32 100644 --- a/activitysim/abm/models/location_choice.py +++ b/activitysim/abm/models/location_choice.py @@ -17,6 +17,7 @@ ) from activitysim.core.interaction_sample import interaction_sample from activitysim.core.interaction_sample_simulate import interaction_sample_simulate +from activitysim.core.util import reindex # import multiprocessing @@ -157,6 +158,8 @@ def _location_sample( "orig_col_name": skims.orig_key, # added for sharrow flows "dest_col_name": skims.dest_key, # added for sharrow flows "timeframe": "timeless", + "reindex": reindex, + "land_use": inject.get_table("land_use").to_frame(), } locals_d.update(model_settings.CONSTANTS or {}) @@ -620,6 +623,8 @@ def run_location_simulate( "orig_col_name": skims.orig_key, # added for sharrow flows "dest_col_name": skims.dest_key, # added for sharrow flows "timeframe": "timeless", + "reindex": reindex, + "land_use": inject.get_table("land_use").to_frame(), } locals_d.update(model_settings.CONSTANTS or {}) From 4201d36ed7678a844a8a7dd3c904edef4620398f Mon Sep 17 00:00:00 2001 From: David Hensle Date: Fri, 15 Dec 2023 17:44:06 -0800 Subject: [PATCH 2/3] landuse available in trip destination --- activitysim/abm/models/trip_destination.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/activitysim/abm/models/trip_destination.py b/activitysim/abm/models/trip_destination.py index 9b7983c87..750355b11 100644 --- a/activitysim/abm/models/trip_destination.py +++ b/activitysim/abm/models/trip_destination.py @@ -193,6 +193,7 @@ def _destination_sample( "size_terms": size_term_matrix, "size_terms_array": size_term_matrix.df.to_numpy(), "timeframe": "trip", + "land_use": inject.get_table("land_use").to_frame(), } ) locals_dict.update(skims) @@ -925,6 +926,7 @@ def trip_destination_simulate( "size_terms": size_term_matrix, "size_terms_array": size_term_matrix.df.to_numpy(), "timeframe": "trip", + "land_use": inject.get_table("land_use").to_frame(), } ) locals_dict.update(skims) From 48be6f4f567e27117379766fa33ce8ace8b334f6 Mon Sep 17 00:00:00 2001 From: David Hensle Date: Thu, 7 Mar 2024 13:56:38 -0800 Subject: [PATCH 3/3] replace orca inject with state object --- activitysim/abm/models/location_choice.py | 4 ++-- activitysim/abm/models/trip_destination.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/activitysim/abm/models/location_choice.py b/activitysim/abm/models/location_choice.py index 8ef502d32..a7e4f0342 100644 --- a/activitysim/abm/models/location_choice.py +++ b/activitysim/abm/models/location_choice.py @@ -159,7 +159,7 @@ def _location_sample( "dest_col_name": skims.dest_key, # added for sharrow flows "timeframe": "timeless", "reindex": reindex, - "land_use": inject.get_table("land_use").to_frame(), + "land_use": state.get_dataframe("land_use"), } locals_d.update(model_settings.CONSTANTS or {}) @@ -624,7 +624,7 @@ def run_location_simulate( "dest_col_name": skims.dest_key, # added for sharrow flows "timeframe": "timeless", "reindex": reindex, - "land_use": inject.get_table("land_use").to_frame(), + "land_use": state.get_dataframe("land_use"), } locals_d.update(model_settings.CONSTANTS or {}) diff --git a/activitysim/abm/models/trip_destination.py b/activitysim/abm/models/trip_destination.py index 750355b11..6dea50980 100644 --- a/activitysim/abm/models/trip_destination.py +++ b/activitysim/abm/models/trip_destination.py @@ -193,7 +193,7 @@ def _destination_sample( "size_terms": size_term_matrix, "size_terms_array": size_term_matrix.df.to_numpy(), "timeframe": "trip", - "land_use": inject.get_table("land_use").to_frame(), + "land_use": state.get_dataframe("land_use"), } ) locals_dict.update(skims) @@ -926,7 +926,7 @@ def trip_destination_simulate( "size_terms": size_term_matrix, "size_terms_array": size_term_matrix.df.to_numpy(), "timeframe": "trip", - "land_use": inject.get_table("land_use").to_frame(), + "land_use": state.get_dataframe("land_use"), } ) locals_dict.update(skims)