Skip to content

Commit

Permalink
Merge pull request #19 from psrc/dev_RSG
Browse files Browse the repository at this point in the history
Dev rsg
  • Loading branch information
bricegnichols authored Mar 7, 2023
2 parents 2cce800 + a7d0f20 commit 76b767d
Show file tree
Hide file tree
Showing 20 changed files with 1,126 additions and 953 deletions.
4 changes: 2 additions & 2 deletions configs_dev/accessibility.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Description,Target,Expression
#,, auto peak
#,,
#,, assume peak occurs in AM for outbound and PM for inbound
peak round trip distance,_auPkTime,"skim_od[('SOVTOLL_TIME', 'AM')] + skim_do[('SOVTOLL_TIME', 'PM')]"
peak round trip distance,_auPkTime,"skim_od[('SOVTOLL_TIME_M', 'AM')] + skim_do[('SOVTOLL_TIME_M', 'PM')]"
decay function,_decay, exp(_auPkTime * dispersion_parameter_automobile)
auto peak retail,auPkRetail,df.RETEMPN * _decay
auto peak total,auPkTotal,df.TOTEMP * _decay
#,,
#,, auto off-peak
#,,
#,, assume midday occurs entirely in the midday period
off-peak round trip distance,_auOpTime,"skim_od[('SOVTOLL_TIME', 'MD')] + skim_do[('SOVTOLL_TIME', 'MD')]"
off-peak round trip distance,_auOpTime,"skim_od[('SOVTOLL_TIME_M', 'MD')] + skim_do[('SOVTOLL_TIME_M', 'MD')]"
decay function,_decay, exp(_auOpTime * dispersion_parameter_automobile)
auto off-peak retail,auOpRetail,df.RETEMPN * _decay
auto off-peak total,auOpTotal,df.TOTEMP * _decay
Expand Down
9 changes: 9 additions & 0 deletions configs_dev/annotate_persons.csv
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ school_segment university,school_segment,"np.where(is_university, SCHOOL_SEGMENT
is_worker,is_worker,"persons.pemploy.isin([PEMPLOY_FULL, PEMPLOY_PART])"
#,,
home_zone_id,home_zone_id,"reindex(households.home_zone_id, persons.household_id)"
,_mean_work,distributed_time_factor_work_mean
,_stddev_work,distributed_time_factor_work_stddev
,_mean_nonwork,distributed_time_factor_nonwork_mean
,_stddev_nonwork,distributed_time_factor_nonwork_stddev
,_min_time_factor,distributed_time_factor_min
,_max_time_factor,distributed_time_factor_max
#,,"Below expression was previously done using np.clip, but was producing a NotImplemented error for mixed DataFrame and Series Inputs. Reimplemented using min & max"
travel time sensitivity factor for work travel,time_factor_work,"np.minimum(_max_time_factor, np.maximum(rng.lognormal_for_df(persons, mu=_mean_work, sigma=_stddev_work), _min_time_factor))"
travel time sensitivity factor for non-work travel,time_factor_nonwork,"np.minimum(_max_time_factor, np.maximum(rng.lognormal_for_df(persons, mu=_mean_nonwork, sigma=_stddev_nonwork), _min_time_factor)) "
4 changes: 2 additions & 2 deletions configs_dev/annotate_persons_school.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Description,Target,Expression
#,, annotate persons table after school_location model has run
,distance_to_school,"np.where(persons.school_zone_id>=0,skim_dict.lookup(persons.home_zone_id, persons.school_zone_id, 'DIST'),np.nan)"
#,, this uses the free flow travel time in both directions. MTC TM1 was MD and MD
temp auto_time_to_school,_auto_time_to_school,"skim_dict.lookup(persons.home_zone_id, persons.school_zone_id, ('SOV_TIME', 'MD'))"
temp auto_time_return,_auto_time_return,"skim_dict.lookup(persons.school_zone_id, persons.home_zone_id, ('SOV_TIME', 'MD'))"
temp auto_time_to_school,_auto_time_to_school,"skim_dict.lookup(persons.home_zone_id, persons.school_zone_id, ('SOV_TIME_M', 'MD'))"
temp auto_time_return,_auto_time_return,"skim_dict.lookup(persons.school_zone_id, persons.home_zone_id, ('SOV_TIME_M', 'MD'))"
free flow roundtrip_auto_time_to_school,roundtrip_auto_time_to_school,"np.where(persons.school_zone_id>=0,_auto_time_to_school + _auto_time_return,0)"
4 changes: 2 additions & 2 deletions configs_dev/annotate_persons_workplace.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ workplace_in_cbd,workplace_in_cbd,"reindex(land_use.area_type, persons.workplace
work_zone_area_type,work_zone_area_type,"reindex(land_use.area_type, persons.workplace_zone_id)"
#,, auto time to work - free flow travel time in both directions. MTC TM1 was MD and MD
#,,roundtrip_auto_time_to_work
,_auto_time_home_to_work,"skim_dict.lookup(persons.home_zone_id, persons.workplace_zone_id, ('SOV_TIME', 'MD'))"
,_auto_time_work_to_home,"skim_dict.lookup(persons.workplace_zone_id, persons.home_zone_id, ('SOV_TIME', 'MD'))"
,_auto_time_home_to_work,"skim_dict.lookup(persons.home_zone_id, persons.workplace_zone_id, ('SOV_TIME_M', 'MD'))"
,_auto_time_work_to_home,"skim_dict.lookup(persons.workplace_zone_id, persons.home_zone_id, ('SOV_TIME_M', 'MD'))"
,roundtrip_auto_time_to_work,"np.where(persons.workplace_zone_id>=0,_auto_time_home_to_work + _auto_time_work_to_home,0)"
#,,_roundtrip_walk_time_to_work
,_MAX_TIME_TO_WORK,999
Expand Down
13 changes: 13 additions & 0 deletions configs_dev/constants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,16 @@ PTYPE_NAME:
CDAP_ACTIVITY_MANDATORY: M
CDAP_ACTIVITY_NONMANDATORY: N
CDAP_ACTIVITY_HOME: H

# annotate persons: time_factor
distributed_time_factor_work_mean: 1.0
distributed_time_factor_work_stddev: 0.7
distributed_time_factor_nonwork_mean: 1.0
distributed_time_factor_nonwork_stddev: 0.6
distributed_time_factor_min: 0.1
distributed_time_factor_max: 10

cost_share_s2: 2
cost_share_s3: 3
vot_threshold_low: 8.81
vot_threshold_med: 18.00
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Description,Target,Expression
destination in central business district,destination_in_cbd,"(reindex(land_use.area_type, joint_tours.destination) < setting('cbd_threshold')) * 1"
#,, this uses the free flow travel time in both directions. MTC TM1 was MD and MD
temp auto_time_to_destination,_auto_time_to_destination,"skim_dict.lookup(joint_tours.origin, joint_tours.destination, ('SOV_TIME', 'MD'))"
temp auto_time_return,_auto_time_return,"skim_dict.lookup(joint_tours.destination, joint_tours.origin, ('SOV_TIME', 'MD'))"
temp auto_time_to_destination,_auto_time_to_destination,"skim_dict.lookup(joint_tours.origin, joint_tours.destination, ('SOV_TIME_M', 'MD'))"
temp auto_time_return,_auto_time_return,"skim_dict.lookup(joint_tours.destination, joint_tours.origin, ('SOV_TIME_M', 'MD'))"
free flow roundtrip_auto_time,roundtrip_auto_time,"_auto_time_to_destination + _auto_time_return"
#"number of joint tours that this joint tours point_person participates in",,
,num_person_joint_tours,"reindex_i(joint_tour_participants.groupby('person_id').size(), joint_tours.person_id)"
Loading

0 comments on commit 76b767d

Please sign in to comment.