-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #218 from SANDAG/ABM3_traffic_assignment
Update traffic_assignment.py
- Loading branch information
Showing
1 changed file
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|