Skip to content

Commit

Permalink
Merge pull request #214 from SANDAG/add_microaccess_to_ttr
Browse files Browse the repository at this point in the history
Add micromobility access to travel time reporter
  • Loading branch information
bhargavasana authored Oct 15, 2024
2 parents d5a48a9 + f54463e commit fb52255
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/python/TravelTimeReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,23 @@ def coalesce_results(self):
).reset_index().fillna(self.settings["infinity"]).sort_values(
["i", "j"]
)

_ebikeMaxTime = self.constants["ebikeMaxDist"] / self.constants["ebikeSpeed"] * 60
_escooterMaxTime = self.constants["escooterMaxDist"] / self.constants["escooterSpeed"] * 60

_ebikeTime = self.results["bike"] * self.constants["bikeSpeed"] / self.constants["ebikeSpeed"] + self.results["i"].map(self.land_use["MicroAccessTime"]) + self.constants["microRentTime"]
_escooterTime = self.results["bike"] * self.constants["bikeSpeed"] / self.constants["escooterSpeed"] + self.results["i"].map(self.land_use["MicroAccessTime"]) + self.constants["microRentTime"]

self.results["ebike"] = np.where(
self.results["bike"] == self.settings["infinity"],
_ebikeTime > _ebikeMaxTime,
self.settings["infinity"],
self.results["bike"] * self.constants["bikeSpeed"] / self.constants["ebikeSpeed"]
_ebikeTime
)

self.results["escooter"] = np.where(
self.results["bike"] == self.settings["infinity"],
_escooterTime > _escooterMaxTime,
self.settings["infinity"],
self.results["bike"] * self.constants["bikeSpeed"] / self.constants["escooterSpeed"]
_escooterTime
)

def write_results(self):
Expand Down

0 comments on commit fb52255

Please sign in to comment.