From 07176cc65b7091d7ca4daf99c90237a6ee3b3932 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 1 May 2024 19:03:11 -0500 Subject: [PATCH] minjung priority light control Signed-off-by: Max --- sumo_pipelines/blocks/emissions/config.py | 1 + sumo_pipelines/blocks/emissions/functions.py | 1 + sumo_pipelines/optimization/optimize.py | 2 +- sumo_pipelines/utils/nema_utils.py | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sumo_pipelines/blocks/emissions/config.py b/sumo_pipelines/blocks/emissions/config.py index 120ee12..f3ea50c 100644 --- a/sumo_pipelines/blocks/emissions/config.py +++ b/sumo_pipelines/blocks/emissions/config.py @@ -34,6 +34,7 @@ class EmissionsTableFuelTotalConfig: filter_polygon: Any = field(default=None) average_speed: Any = field(default=None) average_travel_time: Any = field(default=None) + mean_speed: Any = field(default=None) @dataclass diff --git a/sumo_pipelines/blocks/emissions/functions.py b/sumo_pipelines/blocks/emissions/functions.py index c5b6fca..bbc1192 100644 --- a/sumo_pipelines/blocks/emissions/functions.py +++ b/sumo_pipelines/blocks/emissions/functions.py @@ -329,3 +329,4 @@ def emissions_table_to_total( ) # g/veh -> L/veh config.average_speed = float(df["mean_speed"][0]) config.average_travel_time = float(df["mean_travel_time"][0]) + config.mean_speed = float(df["mean_speed"][0]) diff --git a/sumo_pipelines/optimization/optimize.py b/sumo_pipelines/optimization/optimize.py index 402cb2d..99df951 100644 --- a/sumo_pipelines/optimization/optimize.py +++ b/sumo_pipelines/optimization/optimize.py @@ -51,7 +51,7 @@ def initalize_ray(smoke_test: bool): def run_optimization_core(config_obj: OptimizationConfig, smoke_test: bool): # check that GUI is off if we aren't in smoke test mode - if not smoke_test and config_obj.Blocks.SimulationConfig.gui: + if not smoke_test and config_obj.Blocks.get("SimulationConfig", False): print("Turning off GUI for calibration.") config_obj.Blocks.SimulationConfig.gui = False diff --git a/sumo_pipelines/utils/nema_utils.py b/sumo_pipelines/utils/nema_utils.py index 938f9f4..d34aa2c 100644 --- a/sumo_pipelines/utils/nema_utils.py +++ b/sumo_pipelines/utils/nema_utils.py @@ -668,8 +668,8 @@ def add_params_to_xml( tl.update_coordinate_splits( { - 2: 0.5764271155153771, - 6: 0.85, + 2: 0.76666666, + 6: 0.63333333, } )