## 4 Testbed and Experiments
### Experiments
AVs were controlled when within 100 m of the center of the intersection. A representation of this scenario can be seen in Figure 1.  
To obtain a wide variety of situations that challenge the control algorithm, the simulated flow pattern was set as shown in Figure 5a. The vehicle flow pattern shown indicates the number of simulated vehicles per lane per simulated hour on the North (N), South (S), West (W), and East (E) branches. The flow is symmetrical on the opposite branches (NS and WE). The metrics, optimized by the DRL algorithm, were the number of collisions and time loss of vehicles due to intersection congestion, with the reward function followed by the DRL algorithm being as follows:  
* \(-100\) when there was an accident;
* \(+100\) when a vehicle crossed the intersection without an accident;
* \(-\)_control interval_ (\(-0.25\)) at each simulation interval to encourage optimization of time loss and crossing as quickly as possible. These reward signals are determined in the original paper [4]. The metrics analyzed in the training scenario were the waiting time of the vehicles, the number of accidents, and the global reward obtained by the DRL algorithm in each simulation. The optimization process  
Figure 4: The architecture of the latency forecast module is composed of a transformer network and 3 fully connected layers. The size of the transformer network input depends on the size of the considered window (\(h\)), which controls how many previous latencies are considered when predicting. The output of the transformer network is concatenated with the variable of the number of simulated vehicles (to be controlled) and fed into the fully connected layer network. was performed three times, and the results showed the moving average of the mean and the standard deviation. A final scenario was composed of a Manhattan network of 100 intersections (10 \(\times\) 10) to show the performance of the AIM5 LA algorithm, namely Experiment #3. At each intersection, there was an AIM in charge of controlling the vehicles crossing it. The intersections were separated by 250 m, with a similar configuration to the training scenario (4 branches, 3 lanes, left, straight, and right movements allowed). In addition, to illustrate singular situations, a different flow behavior was simulated, shown in Figure 5b. This scenario shows the capabilities of AIM5 LA against situations never seen before during training. A representation of this scenario can be seen in Figure 6.  
Figure 5: Vehicle flow rate per branch used: (**a**) Training scenario; (**b**) Testing scenario. Figure 6: Simulated topology for the testing scenario: Manhattan 10 \(\times\) 10 network with 250 m between each intersection. The metrics analyzed in the test scenario were diverse because SUMO provides a complete set of metrics after each simulation. These metrics were time loss due to congestion at intersections, number of collisions, average waiting time, various pollutant gas metrics (CO\({}_{2}\), PMx), and fuel and electric consumption. Although all the metrics showed are not directly optimized, they are indirectly optimized through the overall optimization process. The vehicle configuration used is shown in Table 2. As can be seen, there were several types of vehicles, with different physical dimensions and characteristics that made them unique, which are available in [41]. To compare the performance of AIM5 LA with other algorithms, we also included the performance evaluation of _adv_.RAIM [4], the AIM algorithm proposed by [PERSON] et al. [25], and two preliminary versions of AIM5 LA, using only the latency of the _ego_-vehicle at the previous time instant (called AIM5 LA_v0.1) and AIM5 LA_v0.1 + the latency forecaster module (called AIM5 LA_v0.2). The use of the preliminary versions of AIM5 LA (AIM5 LA_v0.1 and AIM5 LA_v0.2) serves as an ablation study, allowing us to show the importance of each module, as well as to isolate their contribution.