For example, the controller 252 may regulate a rotation speed of the fan 244 based on the speed of the vehicle, the temperature measured by the temperature sensor 242, the external temperature, or the difference between the temperature measured by the temperature sensor 242 and the external temperature, and operate the fan 244 at the regulated rotation speed. For example, the controller 252 may regulate a rotation speed of the fan 244 based on any combination of the aforementioned factors. Furthermore, the controller 252 may, in addition to, or instead of, regulating the rotation speed of the fan 244, regulate an amount of air entering from the AC vent or cabin vent 246, for example, depending or based on how much cooling is required for one or more of the sensors of the enclosure 200. For example, the controller 252 may regulate the amount of air entering into the AC vent or cabin vent 246 based on one or more of, or any combination of, the speed of the autonomous vehicle, the temperature measured by the temperature sensor 242, the external temperature, the difference between the temperature measured by the temperature sensor 242 and the external temperature, or based on an internal temperature of the LiDAR sensor 230 or the cameras 232 (which may indicate how heavily the LiDAR sensor 230 or the cameras 232 are being used). For example, the controller 252 may regulate the amount of air entering into the AC vent or cabin vent 246 by adjusting a size of an opening of the AC vent or cabin vent 246 (e.g., a radius of the opening of the AC vent or cabin vent 246, or by regulating an amount of air extracted into the AC vent or cabin vent 246. In another embodiment, the controller 252 may regulate an amount of air entering from the AC vent or cabin vent 246 based on the rotation speed of the fan 244. For example, in one embodiment, if the rotation speed of the fan 244 is increased, the controller 252 may reduce the amount of air entering into the AC vent or cabin vent 246 because adequate cooling of the enclosure 200 may already be provided by the fan 244. In one embodiment, the controller 252 may select between using the fan 244 and the AC vent or cabin vent 246 to cool the enclosure 200. For example, the controller 252 may select between using the fan 244 and the AC vent or cabin vent 246 to cool the enclosure 200 based on which method is more energy efficient. In one embodiment, the controller 252 may select using the fan 244 when an amount of cooling to be provided (e.g. which may correspond to the temperature measured by temperature sensor 242) is lower than a threshold (e.g., first threshold) and using the AC vent or cabin vent 246 when the amount of cooling to be provided is greater than the threshold (e.g., first threshold). On the other hand, if the operation of the fan 244 at high rotation speed itself generates heat internally for the fan 244, the controller 252 may increase the amount of air entering into the AC vent or cabin vent 246, or allow air to pass through the AC vent or cabin vent 246 (if no air previously was passing through) to provide cooling for the fan 244. Thus, the controller 252 may increase the amount of air entering into the AC vent or cabin vent 246 as the rotation speed of the fan 244 is increased.