Add configurable NCE
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user