diff --git a/components/i_feed/devices/vehicle.py b/components/i_feed/devices/vehicle.py index d40b0d3..4856273 100644 --- a/components/i_feed/devices/vehicle.py +++ b/components/i_feed/devices/vehicle.py @@ -25,6 +25,8 @@ SCALING = int(os.environ.get('DSE2021_SCALING', 1)) STARTING_VELOCITY = 130 * SCALING # Interval between status updates in seconds (is not scaled) UPDATE_INTERVAL = 1 +# Specify if NCE should happen +NCE = int(os.environ.get('DSE2021_NCE', 1)) # At x km the NCE shall happen NCE_KM = 2.4 # Time in seconds to recover from NCE (will be scaled) @@ -109,7 +111,7 @@ class Vehicle: tl2_loc = geopy.Point(47.90937, 16.20814) # Calculate point 400m south of traffic light 2 nce_point = d.destination(point=tl2_loc, bearing=182) - if self._nce_possible and not self._nce_happened: + if NCE == 1 and self._nce_possible and not self._nce_happened: if self._gps_location.latitude >= nce_point.latitude: self._nce_happened = True self._last_velocity = self.velocity diff --git a/kubernetes/configmaps/simulation-parameters-configmap.yaml b/kubernetes/configmaps/simulation-parameters-configmap.yaml index 616aaea..f28712b 100644 --- a/kubernetes/configmaps/simulation-parameters-configmap.yaml +++ b/kubernetes/configmaps/simulation-parameters-configmap.yaml @@ -4,6 +4,7 @@ metadata: name: simulation-parameters-configmap data: DSE2021_SCALING: "2" + DSE2021_NCE: "1" DSE2021_CAR1_SV: "130" DSE2021_CAR2_SV: "130" DSE2021_CAR3_SV: "130" diff --git a/kubernetes/deployments/ifeed-deployment.yaml b/kubernetes/deployments/ifeed-deployment.yaml index 1c97828..2e00553 100644 --- a/kubernetes/deployments/ifeed-deployment.yaml +++ b/kubernetes/deployments/ifeed-deployment.yaml @@ -26,6 +26,11 @@ spec: configMapKeyRef: name: simulation-parameters-configmap key: DSE2021_SCALING + - name: DSE2021_NCE + valueFrom: + configMapKeyRef: + name: simulation-parameters-configmap + key: DSE2021_NCE restartPolicy: Always serviceAccountName: "" volumes: null