Add configurable NCE
This commit is contained in:
parent
779f74e825
commit
322d22ea6c
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user