Skip to content

Commit

Permalink
Merge pull request #227 from SANDAG/ABM3_transit_assignment
Browse files Browse the repository at this point in the history
Link Transit Travel Times
  • Loading branch information
bhargavasana authored Oct 25, 2024
2 parents 724a8a5 + 0627b67 commit e547586
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
16 changes: 9 additions & 7 deletions src/main/emme/toolbox/assignment/build_transit_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,15 @@ def __call__(self, period, base_scenario, transit_emmebank, scenario_id, scenari
# (The auto_time attribute is generated from the VDF values which include reliability factor)
## also copying auto_time to ul1, so it does not get wiped when transit connectors are created.

src_attrs = [params["fixed_link_time"]]
dst_attrs = ["data2"]
if scenario.has_traffic_results and "@auto_time" in scenario.attributes("LINK"):
src_attrs.extend(["@auto_time", "@auto_time"])
dst_attrs.extend(["auto_time", "data1"])
values = network.get_attribute_values("LINK", src_attrs)
network.set_attribute_values("LINK", dst_attrs, values)
for link in network.links():
if scenario.has_traffic_results and "@auto_time" in scenario.attributes("LINK"):
link["auto_time"]=link["@auto_time"]
link["data1"]=link["@auto_time"]
rail_modes = set(network.mode(m) for m in "lco")
if link.modes & rail_modes:
link["data2"]=link[params["fixed_rail_link_time"]]
else:
link["data2"]=link[params["fixed_bus_link_time"]]

scenario.publish_network(network)
self._node_id_tracker = None
Expand Down
15 changes: 10 additions & 5 deletions src/main/emme/toolbox/assignment/transit_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ def get_perception_parameters(self, period):
"xfer_headway": "@headway_ea",
"fare": "@fare_per_op",
"in_vehicle": "@vehicle_per_op",
"fixed_link_time": "@trtime"
"fixed_rail_link_time": "@trtime",
"fixed_bus_link_time": "@time_link_ea"
},
"AM": {
"access" : access,
Expand All @@ -280,7 +281,8 @@ def get_perception_parameters(self, period):
"xfer_headway": "@headway_am",
"fare": "@fare_per_pk",
"in_vehicle": "@vehicle_per_pk",
"fixed_link_time": "@trtime"
"fixed_rail_link_time": "@trtime",
"fixed_bus_link_time": "@time_link_am"
},
"MD": {
"access" : access,
Expand All @@ -293,7 +295,8 @@ def get_perception_parameters(self, period):
"xfer_headway": "@headway_md",
"fare": "@fare_per_op",
"in_vehicle": "@vehicle_per_op",
"fixed_link_time": "@trtime"
"fixed_rail_link_time": "@trtime",
"fixed_bus_link_time": "@time_link_md"
},
"PM": {
"access" : access,
Expand All @@ -306,7 +309,8 @@ def get_perception_parameters(self, period):
"xfer_headway": "@headway_pm",
"fare": "@fare_per_pk",
"in_vehicle": "@vehicle_per_pk",
"fixed_link_time": "@trtime"
"fixed_rail_link_time": "@trtime",
"fixed_bus_link_time": "@time_link_pm"
},
"EV": {
"access" : access,
Expand All @@ -319,7 +323,8 @@ def get_perception_parameters(self, period):
"xfer_headway": "@headway_ev",
"fare": "@fare_per_op",
"in_vehicle": "@vehicle_per_op",
"fixed_link_time": "@trtime"
"fixed_rail_link_time": "@trtime",
"fixed_bus_link_time": "@time_link_ev"
}
}
return perception_parameters[period]
Expand Down
1 change: 1 addition & 0 deletions src/main/emme/toolbox/export/export_data_loader_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ def get_xfer_link(node, timed_xfer_link, is_outgoing=True):
next_seg = seg2.line.segment(seg2.number+1)
for attr in segment_alights:
next_seg[attr] += seg2[attr]
attr_map["transit_time"] = seg1["transit_time"] + seg2["transit_time"]
network.merge_links(node, mapping)

# Backup transit lines with altered routes and remove from network
Expand Down

0 comments on commit e547586

Please sign in to comment.