Method to check if there is a red light affecting us. This version of the method is compatible with both European and US style traffic lights. :param lights_list: list containing TrafficLight objects :return: a tuple given by (bool_flag, traffic_light), where
(self, lights_list)
| 59 | return control |
| 60 | |
| 61 | def _is_light_red(self, lights_list): |
| 62 | """ |
| 63 | Method to check if there is a red light affecting us. This version of |
| 64 | the method is compatible with both European and US style traffic lights. |
| 65 | |
| 66 | :param lights_list: list containing TrafficLight objects |
| 67 | :return: a tuple given by (bool_flag, traffic_light), where |
| 68 | - bool_flag is True if there is a traffic light in RED |
| 69 | affecting us and False otherwise |
| 70 | - traffic_light is the object itself or None if there is no |
| 71 | red traffic light affecting us |
| 72 | """ |
| 73 | if self._map.name == 'Town01' or self._map.name == 'Town02': |
| 74 | return self._is_light_red_europe_style(lights_list) |
| 75 | else: |
| 76 | return self._is_light_red_us_style(lights_list) |
| 77 | |
| 78 | def _is_light_red_europe_style(self, lights_list): |
| 79 | """ |
no test coverage detected