Skip to content

Commit

Permalink
Merge pull request #216 from SANDAG/ttr_all_transit_modes
Browse files Browse the repository at this point in the history
Include all transit modes in travel time reporter
  • Loading branch information
bhargavasana authored Oct 16, 2024
2 parents c5eaef7 + b193c46 commit 34ff5bf
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/python/AMTravelTimeReporterConfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ infinity: 999
outfile: report\walkMgrasWithin45Min_AM.csv

transit_skim_matrices: # If set to True, replace values of zero with the number set as infinity
WALK_LOC_FIRSTWAIT__{}: False
WALK_LOC_XFERWALK__{}: False
WALK_LOC_XFERWAIT__{}: False
WALK_LOC_TOTALIVTT__{}: True
WALK_PRM_FIRSTWAIT__{}: False
WALK_PRM_XFERWALK__{}: False
WALK_PRM_XFERWAIT__{}: False
WALK_PRM_TOTALIVTT__{}: True
WALK_MIX_FIRSTWAIT__{}: False
WALK_MIX_XFERWALK__{}: False
WALK_MIX_XFERWAIT__{}: False
Expand Down
8 changes: 8 additions & 0 deletions src/main/python/MDTravelTimeReporterConfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ infinity: 999
outfile: report\walkMgrasWithin45Min_MD.csv

transit_skim_matrices: # If set to True, replace values of zero with the number set as infinity
WALK_LOC_FIRSTWAIT__{}: False
WALK_LOC_XFERWALK__{}: False
WALK_LOC_XFERWAIT__{}: False
WALK_LOC_TOTALIVTT__{}: True
WALK_PRM_FIRSTWAIT__{}: False
WALK_PRM_XFERWALK__{}: False
WALK_PRM_XFERWAIT__{}: False
WALK_PRM_TOTALIVTT__{}: True
WALK_MIX_FIRSTWAIT__{}: False
WALK_MIX_XFERWALK__{}: False
WALK_MIX_XFERWAIT__{}: False
Expand Down
25 changes: 24 additions & 1 deletion src/main/python/TravelTimeReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,36 @@ def get_transit_time(self):
Obtains the total transit time, not including access or egress
"""
print("Calculating transit times")
self.skims["transit_time"] = self.expand_skim(

_loc_time = (
self.skims["WALK_LOC_FIRSTWAIT__" + self.settings["time_period"]] +
self.skims["WALK_LOC_XFERWALK__" + self.settings["time_period"]] +
self.skims["WALK_LOC_XFERWAIT__" + self.settings["time_period"]] +
self.skims["WALK_LOC_TOTALIVTT__" + self.settings["time_period"]]
)

_prm_time = (
self.skims["WALK_PRM_FIRSTWAIT__" + self.settings["time_period"]] +
self.skims["WALK_PRM_XFERWALK__" + self.settings["time_period"]] +
self.skims["WALK_PRM_XFERWAIT__" + self.settings["time_period"]] +
self.skims["WALK_PRM_TOTALIVTT__" + self.settings["time_period"]]
)

_mix_time = (
self.skims["WALK_MIX_FIRSTWAIT__" + self.settings["time_period"]] +
self.skims["WALK_MIX_XFERWALK__" + self.settings["time_period"]] +
self.skims["WALK_MIX_XFERWAIT__" + self.settings["time_period"]] +
self.skims["WALK_MIX_TOTALIVTT__" + self.settings["time_period"]]
)

self.skims["transit_time"] = self.expand_skim(
np.minimum(
_loc_time,
_prm_time,
_mix_time
)
)

def get_total_transit_time(self):
"""
Calculates the total time based on access, transit, and egress times
Expand Down

0 comments on commit 34ff5bf

Please sign in to comment.