Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tm2py/components/network/create_tod_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,25 +163,32 @@ def _create_highway_scenarios(self):
# "(el1 + 60 * (0.25 *(put(put((volau + volad)/el2) - 1) + "
# "(((get(2)*get(2) + (16 * el3 * get(1)^0.5))))"
)
# SFCTA bpr curve https://github.com/BayAreaMetro/tm2py/issues/147#issuecomment-2261058755
bpr_local_tmplt="el1 * 1.8 * (1 + 0.60 * ((volau + volad)/el2)^8.5)"
for f_id in ["fd1", "fd2"]:
if emmebank.function(f_id):
emmebank.delete_function(f_id)
emmebank.create_function(
f_id, bpr_tmplt + reliability_tmplt.format(**parameters["freeway"])
)
for f_id in ["fd6", "fd7"]:
if emmebank.function(f_id):
emmebank.delete_function(f_id)
emmebank.create_function(
f_id, bpr_local_tmplt + reliability_tmplt.format(**parameters["road"])
)
for f_id in [
"fd3",
"fd4",
"fd5",
"fd6",
"fd7",
"fd9",
"fd10",
"fd11",
"fd12",
"fd13",
"fd14",
"fd99",
"fd70", # separate out toll plaza links
]:
if emmebank.function(f_id):
emmebank.delete_function(f_id)
Expand Down
8 changes: 7 additions & 1 deletion tm2py/components/network/highway/highway_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,17 @@ def _set_vdf_attributes(self, network: EmmeNetwork, time_period: str):
for tp in self.controller.config.time_periods
}
period_capacity_factor = tp_mapping[time_period]
akcelik_vdfs = [3, 4, 5, 7, 8, 10, 11, 12, 13, 14]
akcelik_vdfs = [3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 70]
for link in network.links():
cap_lanehour = capacity_map[link["@capclass"]]
link["@capacity"] = cap_lanehour * period_capacity_factor * link["@lanes"]
link.volume_delay_func = int(link["@ft"])
# separate out toll plaza links
if (
link["@tollbooth"] > 0
and link["@tollbooth"] < self.config.tolls.valuetoll_start_tollbooth_code
):
link.volume_delay_func = 70 # use akcelik for toll plaza
# re-mapping links with type 99 to type 7 "local road of minor importance"
if link.volume_delay_func == 99:
link.volume_delay_func = 7
Expand Down