## 3 Beam Allocation Algorithm Based on MAPPO and Stackelberg Game
### Beam Allocation Algorithm Based on MAPPO
Each unit change on the horizontal axis corresponds to 14,400 time slots or 32 episodes. First, we present the cumulative reward curves for the proposed algorithm and other comparison algorithms, as shown in Figure 5, to validate the effectiveness and convergence of the algorithm. This figure is obtained under the condition of reward weight \(w_{e}=1\), \(w_{r}=1,\ w_{R}=1\) and 64 transmit and receive antennas, with similar trends observed under other conditions. The IMSBA algorithm achieves the optimal convergence performance, with an average reward per time slot of 121.8, validating the effectiveness of the proposed algorithm. Due to the instability caused by multi-agent actions, the DQN-based ISSBA algorithm fails to learn effectively, resulting in the worst convergence performance, with

\[L(w_{act})=-L^{clip}(w_{act})-S[\pi_{w_{act}}], \tag{15}\]3 Sensing neighbor list. an average reward per time slot of 76.2. In related ablation experiments, the IMSBA w/o allocate algorithm, which does not perform joint power allocation and uses fixed power instead, shows inferior convergence performance compared to the IMSBA algorithm. Additionally, the convergence performance of the IMSBA w/o allocate algorithm improves with increasing transmit power, primarily because a higher transmit power enhances V2V sensing performance and I2V communication performance, outweighing the decrease in V2V energy efficiency. The IMSBA w/o switch algorithm, which does not switch target vehicles, suffers from link blockage or excessive communication distance, resulting in lower convergence performance compared to the IMSBA algorithm. It is noteworthy that the convergence performance of the IMSBA w/o switch algorithm is also lower than that of the IMSBA w/o allocate algorithm, indicating that the performance gain from switching target vehicles is greater than that from joint power allocation. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Initial x-axis positions of the V2V vehicles & \(30,10,30,20\) m \\ Initial x-axis positions of the I2V vehicles & \(20,5\) m \\ Velocity of V2V vehicles & \(15,20,10,15\) m/s \\ Velocity of I2V vehicles & \(10,15\) m/s \\ The location of RSU & \([60,120]\) m \\ Time slot \(\Delta T\) & \(20\) ms \\ Transmit and receive antennas \(N_{t},N_{r}\) & \(64\) \\ RSU transmit antenna \(N_{t}^{R}\) & \(64\) \\ Angular interval of adjacent indices & \(0.025\) rad \\ in the codebook \(\Delta\theta\) & \\ Center frequency \(f_{c}\) & \(30\) GHz \\ Complex radar cross section \(\varepsilon\) & \(10+10j\) \\ Channel power gain \(\tilde{\kappa}\) & \(1\) \\ Noise variance & \(\sigma^{2}=\delta_{c}^{2}=1\) \\ Matched filter gain \(G\) & \(10\) \\ Proportional coefficient & \(0.01\) \\ Relative change set \(g\) & \(g=\{-1,0,1\}\) \\ Transmit power range & \(p\in[1,20]\) W \\ Learning rate \(\varphi\) & \(0.0005\) \\ Discount factor \(\gamma\) & \(0.99\) \\ Experience pool size \(samp\) & \(32\) \\ MaxStep & \(450\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameter settings. Figure 4: Real-road trajectory. We present individual curves for the components of cumulative reward shown in Figure 5 and compare them with other benchmark algorithms. The energy efficiency change curve is depicted in Figure 6. Due to IMSBA w/o allocate fixing the transmission power at 1 W, this algorithm achieves the highest energy efficiency, which is 8.1% higher compared to the IMSBA algorithm. IMSBA w/o switch experiences significant path loss due to not switching target vehicles, resulting in a 30% lower energy efficiency compared to the IMSBA algorithm.