From 10f77c99f6d5133d359973f3292ef773799c35ee Mon Sep 17 00:00:00 2001 From: Tobias Eidelpes Date: Thu, 17 Jun 2021 22:51:49 +0200 Subject: [PATCH] Set default SCALING to 1 --- components/i_feed/devices/traffic_light.py | 2 +- components/i_feed/devices/vehicle.py | 2 +- components/orchestration/orchestrator.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/i_feed/devices/traffic_light.py b/components/i_feed/devices/traffic_light.py index b194f7a..9ec4fb8 100644 --- a/components/i_feed/devices/traffic_light.py +++ b/components/i_feed/devices/traffic_light.py @@ -14,7 +14,7 @@ from pika.exceptions import AMQPConnectionError SWITCHING_TIME = 15 # Scale speed of switching by factor x -SCALING = int(os.environ['DSE2021_SCALING']) +SCALING = int(os.environ.get('DSE2021_SCALING', 1)) class TrafficLight: diff --git a/components/i_feed/devices/vehicle.py b/components/i_feed/devices/vehicle.py index 3440cec..2485de9 100644 --- a/components/i_feed/devices/vehicle.py +++ b/components/i_feed/devices/vehicle.py @@ -20,7 +20,7 @@ STARTING_POINT = geopy.Point(47.89053, 16.20703) # Driving direction in degrees: 0=N, 90=E, 180=S, 270=W BEARING = 2 # Scale speed of vehicles by factor x -SCALING = int(os.environ['DSE2021_SCALING']) +SCALING = int(os.environ.get('DSE2021_SCALING', 1)) # in km/h STARTING_VELOCITY = 130 * SCALING # Interval between status updates in seconds (is not scaled) diff --git a/components/orchestration/orchestrator.py b/components/orchestration/orchestrator.py index 2135582..d374e1f 100644 --- a/components/orchestration/orchestrator.py +++ b/components/orchestration/orchestrator.py @@ -23,7 +23,7 @@ sys.modules['target_velocity'] = target_velocity ENTITY_IDENT_URL = 'http://entityident:5002/api/v1/resources/' -SCALING = int(os.environ['DSE2021_SCALING']) +SCALING = int(os.environ.get('DSE2021_SCALING', 1)) class Orchestrator: