@@ -75,11 +75,11 @@ def test_fully_distracted_driver(self):
7575 assert len (events [int ((d_status .settings ._DISTRACTED_TIME - d_status .settings ._DISTRACTED_PRE_TIME_TILL_TERMINAL )/ 2 / DT_DMON )]) == 0
7676 assert events [int ((d_status .settings ._DISTRACTED_TIME - d_status .settings ._DISTRACTED_PRE_TIME_TILL_TERMINAL + \
7777 ((d_status .settings ._DISTRACTED_PRE_TIME_TILL_TERMINAL - d_status .settings ._DISTRACTED_PROMPT_TIME_TILL_TERMINAL )/ 2 ))/ DT_DMON )].names [0 ] == \
78- EventName .preDriverDistracted
78+ EventName .driverDistracted1
7979 assert events [int ((d_status .settings ._DISTRACTED_TIME - d_status .settings ._DISTRACTED_PROMPT_TIME_TILL_TERMINAL + \
80- ((d_status .settings ._DISTRACTED_PROMPT_TIME_TILL_TERMINAL )/ 2 ))/ DT_DMON )].names [0 ] == EventName .promptDriverDistracted
80+ ((d_status .settings ._DISTRACTED_PROMPT_TIME_TILL_TERMINAL )/ 2 ))/ DT_DMON )].names [0 ] == EventName .driverDistracted2
8181 assert events [int ((d_status .settings ._DISTRACTED_TIME + \
82- ((TEST_TIMESPAN - 10 - d_status .settings ._DISTRACTED_TIME )/ 2 ))/ DT_DMON )].names [0 ] == EventName .driverDistracted
82+ ((TEST_TIMESPAN - 10 - d_status .settings ._DISTRACTED_TIME )/ 2 ))/ DT_DMON )].names [0 ] == EventName .driverDistracted3
8383 assert isinstance (d_status .awareness , float )
8484
8585 # engaged, no face detected the whole time, no action
@@ -88,11 +88,11 @@ def test_fully_invisible_driver(self):
8888 assert len (events [int ((d_status .settings ._AWARENESS_TIME - d_status .settings ._AWARENESS_PRE_TIME_TILL_TERMINAL )/ 2 / DT_DMON )]) == 0
8989 assert events [int ((d_status .settings ._AWARENESS_TIME - d_status .settings ._AWARENESS_PRE_TIME_TILL_TERMINAL + \
9090 ((d_status .settings ._AWARENESS_PRE_TIME_TILL_TERMINAL - d_status .settings ._AWARENESS_PROMPT_TIME_TILL_TERMINAL )/ 2 ))/ DT_DMON )].names [0 ] == \
91- EventName .preDriverUnresponsive
91+ EventName .driverUnresponsive1
9292 assert events [int ((d_status .settings ._AWARENESS_TIME - d_status .settings ._AWARENESS_PROMPT_TIME_TILL_TERMINAL + \
93- ((d_status .settings ._AWARENESS_PROMPT_TIME_TILL_TERMINAL )/ 2 ))/ DT_DMON )].names [0 ] == EventName .promptDriverUnresponsive
93+ ((d_status .settings ._AWARENESS_PROMPT_TIME_TILL_TERMINAL )/ 2 ))/ DT_DMON )].names [0 ] == EventName .driverUnresponsive2
9494 assert events [int ((d_status .settings ._AWARENESS_TIME + \
95- ((TEST_TIMESPAN - 10 - d_status .settings ._AWARENESS_TIME )/ 2 ))/ DT_DMON )].names [0 ] == EventName .driverUnresponsive
95+ ((TEST_TIMESPAN - 10 - d_status .settings ._AWARENESS_TIME )/ 2 ))/ DT_DMON )].names [0 ] == EventName .driverUnresponsive3
9696
9797 # engaged, down to orange, driver pays attention, back to normal; then down to orange, driver touches wheel
9898 # - should have short orange recovery time and no green afterwards; wheel touch only recovers when paying attention
@@ -105,10 +105,10 @@ def test_normal_driver(self):
105105 [car_interaction_DETECTED ] * (int (TEST_TIMESPAN / DT_DMON )- int (DISTRACTED_SECONDS_TO_ORANGE * 3 / DT_DMON ))
106106 events , _ = self ._run_seq (ds_vector , interaction_vector , always_true , always_false )
107107 assert len (events [int (DISTRACTED_SECONDS_TO_ORANGE * 0.5 / DT_DMON )]) == 0
108- assert events [int ((DISTRACTED_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverDistracted
108+ assert events [int ((DISTRACTED_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverDistracted2
109109 assert len (events [int (DISTRACTED_SECONDS_TO_ORANGE * 1.5 / DT_DMON )]) == 0
110- assert events [int ((DISTRACTED_SECONDS_TO_ORANGE * 3 - 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverDistracted
111- assert events [int ((DISTRACTED_SECONDS_TO_ORANGE * 3 + 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverDistracted
110+ assert events [int ((DISTRACTED_SECONDS_TO_ORANGE * 3 - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverDistracted2
111+ assert events [int ((DISTRACTED_SECONDS_TO_ORANGE * 3 + 0.1 )/ DT_DMON )].names [0 ] == EventName .driverDistracted2
112112 assert len (events [int ((DISTRACTED_SECONDS_TO_ORANGE * 3 + 2.5 )/ DT_DMON )]) == 0
113113
114114 # engaged, down to orange, driver dodges camera, then comes back still distracted, down to red, \
@@ -128,9 +128,9 @@ def test_biggest_comma_fan(self):
128128 op_vector [int ((DISTRACTED_SECONDS_TO_RED + 2 * _invisible_time + 2.5 )/ DT_DMON ):int ((DISTRACTED_SECONDS_TO_RED + 2 * _invisible_time + 3 )/ DT_DMON )] \
129129 = [False ] * int (0.5 / DT_DMON )
130130 events , _ = self ._run_seq (ds_vector , interaction_vector , op_vector , always_false )
131- assert events [int ((DISTRACTED_SECONDS_TO_ORANGE + 0.5 * _invisible_time )/ DT_DMON )].names [0 ] == EventName .promptDriverDistracted
132- assert events [int ((DISTRACTED_SECONDS_TO_RED + 1.5 * _invisible_time )/ DT_DMON )].names [0 ] == EventName .driverDistracted
133- assert events [int ((DISTRACTED_SECONDS_TO_RED + 2 * _invisible_time + 1.5 )/ DT_DMON )].names [0 ] == EventName .driverDistracted
131+ assert events [int ((DISTRACTED_SECONDS_TO_ORANGE + 0.5 * _invisible_time )/ DT_DMON )].names [0 ] == EventName .driverDistracted2
132+ assert events [int ((DISTRACTED_SECONDS_TO_RED + 1.5 * _invisible_time )/ DT_DMON )].names [0 ] == EventName .driverDistracted3
133+ assert events [int ((DISTRACTED_SECONDS_TO_RED + 2 * _invisible_time + 1.5 )/ DT_DMON )].names [0 ] == EventName .driverDistracted3
134134 assert len (events [int ((DISTRACTED_SECONDS_TO_RED + 2 * _invisible_time + 3.5 )/ DT_DMON )]) == 0
135135
136136 # engaged, invisible driver, down to orange, driver touches wheel; then down to orange again, driver appears
@@ -144,13 +144,13 @@ def test_sometimes_transparent_commuter(self):
144144 interaction_vector [int ((INVISIBLE_SECONDS_TO_ORANGE )/ DT_DMON ):int ((INVISIBLE_SECONDS_TO_ORANGE + 1 )/ DT_DMON )] = [True ] * int (1 / DT_DMON )
145145 events , _ = self ._run_seq (ds_vector , interaction_vector , 2 * always_true , 2 * always_false )
146146 assert len (events [int (INVISIBLE_SECONDS_TO_ORANGE * 0.5 / DT_DMON )]) == 0
147- assert events [int ((INVISIBLE_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverUnresponsive
147+ assert events [int ((INVISIBLE_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive2
148148 assert len (events [int ((INVISIBLE_SECONDS_TO_ORANGE + 0.1 )/ DT_DMON )]) == 0
149149 if _visible_time == 0.5 :
150- assert events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverUnresponsive
151- assert events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 + 0.1 + _visible_time )/ DT_DMON )].names [0 ] == EventName .preDriverUnresponsive
150+ assert events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive2
151+ assert events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 + 0.1 + _visible_time )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive1
152152 elif _visible_time == 10 :
153- assert events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverUnresponsive
153+ assert events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive2
154154 assert len (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 + 0.1 + _visible_time )/ DT_DMON )]) == 0
155155
156156 # engaged, invisible driver, down to red, driver appears and then touches wheel, then disengages/reengages
@@ -165,10 +165,10 @@ def test_last_second_responder(self):
165165 op_vector [int ((INVISIBLE_SECONDS_TO_RED + _visible_time + 1 )/ DT_DMON ):int ((INVISIBLE_SECONDS_TO_RED + _visible_time + 0.5 )/ DT_DMON )] = [False ] * int (0.5 / DT_DMON )
166166 events , _ = self ._run_seq (ds_vector , interaction_vector , op_vector , always_false )
167167 assert len (events [int (INVISIBLE_SECONDS_TO_ORANGE * 0.5 / DT_DMON )]) == 0
168- assert events [int ((INVISIBLE_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverUnresponsive
169- assert events [int ((INVISIBLE_SECONDS_TO_RED - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive
170- assert events [int ((INVISIBLE_SECONDS_TO_RED + 0.5 * _visible_time )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive
171- assert events [int ((INVISIBLE_SECONDS_TO_RED + _visible_time + 0.5 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive
168+ assert events [int ((INVISIBLE_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive2
169+ assert events [int ((INVISIBLE_SECONDS_TO_RED - 0.1 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive3
170+ assert events [int ((INVISIBLE_SECONDS_TO_RED + 0.5 * _visible_time )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive3
171+ assert events [int ((INVISIBLE_SECONDS_TO_RED + _visible_time + 0.5 )/ DT_DMON )].names [0 ] == EventName .driverUnresponsive3
172172 assert len (events [int ((INVISIBLE_SECONDS_TO_RED + _visible_time + 1 + 0.1 )/ DT_DMON )]) == 0
173173
174174 # disengaged, always distracted driver
@@ -186,8 +186,8 @@ def test_long_traffic_light_victim(self):
186186 events , d_status = self ._run_seq (always_distracted , always_false , always_true , standstill_vector )
187187 assert len (events [int ((_redlight_time - 0.1 )/ DT_DMON )]) == 0
188188 _pre_to_prompt = d_status .settings ._DISTRACTED_PRE_TIME_TILL_TERMINAL - d_status .settings ._DISTRACTED_PROMPT_TIME_TILL_TERMINAL
189- assert events [int ((_redlight_time + 0.5 )/ DT_DMON )].names [0 ] == EventName .preDriverDistracted
190- assert events [int ((_redlight_time + _pre_to_prompt + 0.5 )/ DT_DMON )].names [0 ] == EventName .promptDriverDistracted
189+ assert events [int ((_redlight_time + 0.5 )/ DT_DMON )].names [0 ] == EventName .driverDistracted1
190+ assert events [int ((_redlight_time + _pre_to_prompt + 0.5 )/ DT_DMON )].names [0 ] == EventName .driverDistracted2
191191
192192 # engaged, distracted while moving, then car stops after reaching orange
193193 # - should reset timer to pre green at standstill
@@ -197,7 +197,7 @@ def test_distracted_then_stops(self):
197197 standstill_vector [int (_stop_time / DT_DMON ):] = [True ] * int ((TEST_TIMESPAN - _stop_time )/ DT_DMON )
198198 events , _ = self ._run_seq (always_distracted , always_false , always_true , standstill_vector )
199199 # just before and briefly after stopping: orange alert; goes away quickly after stopped
200- assert events [int ((_stop_time + 0.1 )/ DT_DMON )].names [0 ] == EventName .promptDriverDistracted
200+ assert events [int ((_stop_time + 0.1 )/ DT_DMON )].names [0 ] == EventName .driverDistracted2
201201 assert len (events [int ((_stop_time + 0.5 )/ DT_DMON )]) == 0
202202
203203 # engaged, model is somehow uncertain and driver is distracted
@@ -206,10 +206,9 @@ def test_somehow_indecisive_model(self):
206206 ds_vector = [msg_DISTRACTED_BUT_SOMEHOW_UNCERTAIN ] * int (TEST_TIMESPAN / DT_DMON )
207207 interaction_vector = always_false [:]
208208 events , d_status = self ._run_seq (ds_vector , interaction_vector , always_true , always_false )
209- assert EventName .preDriverUnresponsive in \
209+ assert EventName .driverUnresponsive1 in \
210210 events [int ((INVISIBLE_SECONDS_TO_ORANGE - 1 + DT_DMON * d_status .settings ._HI_STD_FALLBACK_TIME - 0.1 )/ DT_DMON )].names
211- assert EventName .promptDriverUnresponsive in \
211+ assert EventName .driverUnresponsive2 in \
212212 events [int ((INVISIBLE_SECONDS_TO_ORANGE - 1 + DT_DMON * d_status .settings ._HI_STD_FALLBACK_TIME + 0.1 )/ DT_DMON )].names
213- assert EventName .driverUnresponsive in \
213+ assert EventName .driverUnresponsive3 in \
214214 events [int ((INVISIBLE_SECONDS_TO_RED - 1 + DT_DMON * d_status .settings ._HI_STD_FALLBACK_TIME + 0.1 )/ DT_DMON )].names
215-
0 commit comments