Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trip Destination Alts Preprocessor #13

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions configs/resident/trip_destination.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ PRIMARY_DEST: tour_leg_dest # must be created in preprocessor
# (it is assigned in trip_destination_annotate_trips_preprocessor )
REDUNDANT_TOURS_MERGED_CHOOSER_COLUMNS:
- tour_mode



preprocessor:
SPEC: trip_destination_annotate_trips_preprocessor
DF: trips
Expand All @@ -37,6 +35,12 @@ preprocessor:
- households
- land_use

alts_preprocessor:
SPEC: trip_destination_annotate_alts_preprocessor
DF: trips
TABLES:
- land_use


# drop failed trips and cleanup failed trip leg_mates for consistency
# (i.e. adjust trip_count, trip_num, first for missing failed trips)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Description,Target,Expression
max micromobility access time at destination,d_microAccTime,"land_use.sort_values(by='MicroAccessTime',ascending=False).drop_duplicates('TAZ',keep='first').set_index('TAZ')['MicroAccessTime'].reindex(df.index)"
4 changes: 1 addition & 3 deletions configs/resident/trip_destination_sample.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Description,Expression,work,univ,school,escort,shopping,eatout,othmaint,social,o
,_op_DIST@op_skims['DIST'],1,1,1,1,1,1,1,1,1,1
,_od_bikeL@odt_skims['BIKE_LOGSUM'],1,1,1,1,1,1,1,1,1,1
,_dp_bikeL@dpt_skims['BIKE_LOGSUM'],1,1,1,1,1,1,1,1,1,1
# next line gets max MAZ micromobility access time in destination TAZ
,"_d_microAccTime@land_use.sort_values(by='MicroAccessTime',ascending=False).drop_duplicates('TAZ',keep='first').set_index('TAZ')['MicroAccessTime'].reindex(df.dest_taz)",1,1,1,1,1,1,1,1,1,1
#,,,,,,,,,,,
size term,"@np.log1p(size_terms.get(df.dest_taz, df.purpose)) # sharrow: np.log1p(size_terms['sizearray'])",1,1,1,1,1,1,1,1,1,1
no attractions,"@size_terms.get(df.dest_taz, df.purpose) == 0 # sharrow: size_terms['sizearray'] == 0",-999,-999,-999,-999,-999,-999,-999,-999,-999,-999
Expand All @@ -19,4 +17,4 @@ no attractions,"@size_terms.get(df.dest_taz, df.purpose) == 0 # sharrow: size_te
,@df.bikeTour * (_dp_bikeL < -300),-999,-999,-999,-999,-999,-999,-999,-999,-999,-999
#,,,,,,,,,,,
,@(df.nonmotorTour==0) * (_od_DIST + _dp_DIST - _op_DIST),-0.05,-0.05,-0.05,-0.05,-0.05,-0.05,-0.05,-0.05,-0.05,-0.05
,"@(df.microTour * (np.where(_d_microAccTime > microAccessThreshold,1,0) + np.where(df.o_MicroAccessTime > microAccessThreshold,1,0)))",-10,-10,-10,-10,-10,-10,-10,-10,-10,-10
,"@(df.microTour * (np.where(df.d_microAccTime > microAccessThreshold,1,0) + np.where(df.o_MicroAccessTime > microAccessThreshold,1,0)))",-10,-10,-10,-10,-10,-10,-10,-10,-10,-10
Loading