Skip to content

Commit

Permalink
calc bus time for links not assigned in the hwy net
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-sijia committed Jun 12, 2023
1 parent 0ba6b17 commit f388725
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tm2py/components/network/transit/transit_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,17 @@ def _get_highway_travel_times(
_highway_net = _highway_scenario.get_partial_network(
["LINK"], include_attributes=False
)
travel_time_attributes = {"LINK": ["#link_id", "auto_time"]}
travel_time_attributes = {"LINK": ["#link_id", "auto_time", "@lanes"]}
self.emme_manager.copy_attribute_values(
_highway_scenario, _highway_net, travel_time_attributes
)
# TODO can we just get the link attributes as a DataFrame and merge them?
# if the link does not have meaningful travel time in highway assigned network
# such as bus only link, managed lanes, etc.
# assume default bus speed of 30 mph
auto_link_time_dict = {
auto_link["#link_id"]: auto_link.auto_time
auto_link["#link_id"] : ( auto_link.auto_time
if auto_link["@lanes"] > 0 else 60*auto_link["length"]/30 )
for auto_link in _highway_net.links()
}
return auto_link_time_dict
Expand Down

0 comments on commit f388725

Please sign in to comment.