def reset(self):
        """
        Generate traffic on map, according to the mode and density
        :return: List of Traffic vehicles
        """
        map = self.current_map
        logging.debug("load scene {}".format("Use random traffic" if self.random_traffic else ""))

        # update vehicle list
        self.block_triggered_vehicles = []

        traffic_density = self.density
        if abs(traffic_density) < 1e-2:
            return
        self.respawn_lanes = self._get_available_respawn_lanes(map)

        logging.debug(f"Resetting Traffic Manager with mode {self.mode} and density {traffic_density}")

        if self.mode in {TrafficMode.Basic, TrafficMode.Respawn}:
            self._create_basic_vehicles(map, traffic_density)
        elif self.mode in {TrafficMode.Trigger, TrafficMode.Hybrid}:
            self._create_trigger_vehicles(map, traffic_density)
        else:
            raise ValueError(f"No such mode named {self.mode}")

        Generate traffic on map, according to the mode and density
        :return: List of Traffic vehicles
        
metadrive/manager/traffic_manager.py