## 6 Simulation Results
### Performance Analysis
#### 6.2.2 Performance Comparison of Different Aspects  
The distance between two adjacent trains is different and the wayside nodes are uniformly distributed. Thus, when the distance between two trains become larger, the number of trackside nodes between them increases and the topology of the network changes. Figure 5 depicts the curves of the variation of the total delay as the number of nodes increase. It can be observed that the whole-link delay increased from 4.31 ms to 8.43 ms under the MADDQN algorithm. The main reason is that, with the increment in the number of relays, the number of hops required for the whole link increased; thus, the total delay increased. Compared with the random selection scheme and GPSR algorithm, the  
Figure 4: Outage probability and congestion probability of the proposed algorithm. Figure 3: Total reward with different learning rates. transmission delay of the MADDQN algorithm was reduced by an average of 2 ms and 0.5 ms, respectively. Although the traditional GPSR algorithm requires a small number of hops, it cannot avoid congested nodes, resulting in a large packet loss rate. In addition, the random scheme can neither select nodes with small queued tasks nor optimize the hop count; hence, the delay is longer than the previous two algorithms. The effect of buffer size on total delay is investigated in Figure 6. When the buffer size was less than 300 Kb, the total latency increased significantly as the buffer size became larger. When the buffer size was small, the packet queue became shorter, resulting in lower packet delay. Moreover, when the buffer size reached 300 kb, the total delay gradually flattened out. The reason is that nodes were no longer dropping packets, and the queue length of each node tended to be stable. In addition, MADDQN improved by 0.5 ms compared to the GPSR algorithm and 3 ms compared to the random selection scheme, which illustrates that the proposed MADDQN algorithm could select nodes with shorter queues for transmission. Figure 5: Total delay versus the number of nodes. Figure 6: Total delay versus buffer size. Figure 7 presents the relationship between the number of nodes and the average loss rate under different schemes. As the number of nodes increased from four to nine, the packet loss rate of MADDQN increased to 0.12. The reason is that, as the number of hops increased, the total packet loss rate also increased. Compared with the other two schemes, the proposed MADDQN could select the next-hop relay with a shorter queuing number for transmission, which greatly reduced the packet loss probability. While the GPSR algorithm could not avoid congested nodes, it required fewer hops for transmission; hence, the packet loss rate was also lower than the random scheme. Figure 8 depicts the change in the average loss rate with the buffer size. The average packet loss rate rapidly decreased to zero when the buffer size was 300 kb. Due to the small buffer size, packets could easily overflow. Hence, the packet loss rate continued to decrease until the buffer was large enough. The average loss rate of the GPSR and random scheme before 300 kb was higher than MADDQN, which illustrates that our proposed method had a significant effect in avoiding congested nodes and reducing the number of hops, such that the packet loss rate was the lowest. Figure 9 presents how the number of nodes affects the average throughput. It can be observed that the average throughput of the entire link decreased monotonically with the increment in the number of nodes. This is because, as shown in Figure 7, the packet loss rate increased with the number of nodes, it led to a reduction in the overall throughput. The throughput of MADDQN was greater than the other two methods, indicating that, when selecting the next hop node, MADDQN chose the node with relatively large channel throughput and fewer queued packets, ensuring channel quality. Figure 10 shows the impact of buffer size on the throughput.