Add configurable NCE

This commit is contained in:
Tobias Eidelpes 2021-06-18 00:17:09 +02:00
parent 779f74e825
commit 322d22ea6c
3 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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"

View File

@ -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