diff --git a/sumo_project/config.py b/sumo_project/config.py index c2061f4..6fcbc5d 100644 --- a/sumo_project/config.py +++ b/sumo_project/config.py @@ -17,10 +17,13 @@ CELLS_NUMBER = 10 EMISSIONS_THRESHOLD = 500000 n_steps = 200 -#Limit the speed into areas when the threshold is exceeded -limit_speed_mode = True #Vehicles are routed according to the less polluted route weight_routing_mode = False + +#Limit the speed into areas when the threshold is exceeded +limited_speed = 30 +limit_speed_mode = True + #Decrease all traffic lights duration into the area when the threshold is exceeded rf_trafficLights_duration = 0.2 adjust_traffic_light_mode = True diff --git a/sumo_project/emissions.py b/sumo_project/emissions.py index 4cfdf76..b0753ca 100644 --- a/sumo_project/emissions.py +++ b/sumo_project/emissions.py @@ -60,7 +60,7 @@ def get_emissions(grid: List[Area], vehicles: List[Vehicle]): if vehicle.pos in area: area.emissions += vehicle.emissions if config.limit_speed_mode and area.emissions > config.EMISSIONS_THRESHOLD and not area.locked: - actions.limit_speed_into_area(area, vehicles, 30) + actions.limit_speed_into_area(area, vehicles, config.limited_speed) traci.polygon.setColor(area.name, (255, 0, 0)) traci.polygon.setFilled(area.name, True) if config.adjust_traffic_light_mode: