diff --git a/tm2py/components/network/create_tod_scenarios.py b/tm2py/components/network/create_tod_scenarios.py index 1df6284e..5057c5b9 100644 --- a/tm2py/components/network/create_tod_scenarios.py +++ b/tm2py/components/network/create_tod_scenarios.py @@ -163,18 +163,24 @@ 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", @@ -182,6 +188,7 @@ def _create_highway_scenarios(self): "fd13", "fd14", "fd99", + "fd70", # separate out toll plaza links ]: if emmebank.function(f_id): emmebank.delete_function(f_id) diff --git a/tm2py/components/network/highway/highway_network.py b/tm2py/components/network/highway/highway_network.py index f456b604..f63f9d9f 100644 --- a/tm2py/components/network/highway/highway_network.py +++ b/tm2py/components/network/highway/highway_network.py @@ -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