Skip to content

Commit

Permalink
Merge pull request #218 from SANDAG/ABM3_traffic_assignment
Browse files Browse the repository at this point in the history
Update traffic_assignment.py
  • Loading branch information
bhargavasana authored Oct 25, 2024
2 parents 4211f42 + 2ccbeb6 commit e8f6bce
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/main/emme/toolbox/assignment/traffic_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,15 +1018,25 @@ def prepare_midday_generic_truck(self, scenario):
#added by RSG ([email protected]) for collapsed assignment classes testing
#this adds non-transponder SOV mode to SR-125 links
# TODO: move this to the network_import step for consistency and foward-compatibility
# Modified 10.10.24 by CAR based on suggestion from Kevin Bragg of Bentley so that it
# can handle networks that have no HOV = 4 links
def change_mode_sovntp(self, scenario):
modeller = _m.Modeller()
netcalc = modeller.tool(
"inro.emme.network_calculation.network_calculator")
change_link_modes = modeller.tool(
"inro.emme.data.network.base.change_link_modes")
with _m.logbook_trace("Preparation for sov ntp assignment"):
gen_sov_mode = 's'
sov_mode = scenario.mode(gen_sov_mode)
change_link_modes(modes=[sov_mode], action="ADD",
selection="@hov=4", scenario=scenario)
spec = {
"type": "NETWORK_CALCULATION",
"expression": "1",
"selections": {"link": "@hov=4"}}
report = netcalc(spec, scenario=scenario, full_report=True)
if report["num_evaluations"] > 0:
with _m.logbook_trace("Preparation for sov ntp assignment"):
gen_sov_mode = 's'
sov_mode = scenario.mode(gen_sov_mode)
change_link_modes(modes=[sov_mode], action="ADD",
selection="@hov=4", scenario=scenario)

def report(self, period, scenario, classes):
emmebank = scenario.emmebank
Expand Down

0 comments on commit e8f6bce

Please sign in to comment.