# Coverage, Rate, and Last Hop Selection in Multi-Hop Communications in Highway Scenarios
## 3 System Performance Analysis
### System-Level Simulation Tool  
To study the system proposed above, we have developed a system-level mmWave/sub-\(\mathrm{THz}\) signal propagation simulation tool. The pseudocode for calculating the main metrics for FO strategy and windshield-level antenna location is presented in Algorithm 1, while the details of relay selection with regard to the considered last hop selection strategies are schematically shown in Figure 2.  
Algorithm 1 proceeds as follows. We start with the parametrization of our model and the definition of output parameters. At step 1, we introduce the critical distances of communication paths. Then, we allocate the vehicles on the road employing distance distribution (7) until the next vehicle gets over the segment of interest (steps 4-6). First, at steps 8-12, we check if there is an LoS path between the current vehicle and the BS, and if it is reachable, the bridge is established. Otherwise, the possibility of a relay is validated in steps 13-15, and if the bridge is blocked, it is considered unavailable. Within the next steps, we define the appropriate propagation paths of the hops. At steps 16-21, the vehicle attempts to find a LoS path toward a relay. If it is not feasible, the availability of a side reflection on the adjacent lanes is considered (steps 23-25). When neither LoS nor side reflections are available, the algorithm evaluates the channel quality through the front  
Figure 2: Algorithm for bridge construction.  
and rear glasses of the blocking vehicle (25; 26; 27; 28). Having completed \(N_{runs}\) trials, at step 34, we finally calculate the metrics of interest. Alternatively, the algorithm is schematically presented in Figure 3.  
```
0:\(N_{l}\), \(A\), \(P_{E}\), \(ISD\), \(N_{runs}\)
0:\(P_{A}\), \(R_{D}\)
1:\(d_{L}^{max}\), \(d_{R}^{max}\), \(d_{W}^{max}\)
2:\(n=0\), \(P_{A}=0\), \(R_{D}=0\), \(D_{B}=[]\)
3:while\(n<N_{runs}\)do
4:for\(r=0;\sum_{i=0}^{r}d_{i}<=ISD;r=r+1\)do
5: Allocate \(r\)-th vehicle on lanes using \(P_{E}\)
6:endfor
7:\(N_{v}=0\)
8:if distance to base station \(d<d_{L}^{max}\)then
9: connection successful: \(P_{A}=P_{A}+1\)
10: calculate MCS and bridge rate \(r_{D}\) by distance \(d\) and append to sigle-hop distances \(D_{B}\gets d\)
11:\(R_{D}=R_{D}+r_{D}\)
12:endif
13:if next two vehicles are not equipped with transmitters then
14: bridge failure
15:endif
16:if next vehicle has transmitter then
17:if distance to next vehicle \(d<d_{L}^{max}\)then
18:\(D_{B}\gets d\), \(N_{v}=N_{v}+1\)
19:GOTO5
20:endif
21:endif
22:if next vehicle after blocker is equipped with transmitter then
23:if distance to the second next vehicle \(d<d_{R}^{max}\)and there is a reflector vehicle on the adjacent lanes then
24:\(D_{B}\gets d\), \(N_{v}=N_{v}+2\)
25:GOTO5
26:endif
27:if distance to the vehicle \(d<d_{W}^{max}\)then
28:\(D_{B}\gets d\), \(N_{v}=N_{v}+2\)
29:GOTO5
30:endif
31:endif
32:\(n=n+1\)
33:endwhile
34:\(P_{A}=P_{A}/N_{runs}\), \(R_{D}=R_{D}/N_{runs}\)
```  
**Algorithm 1** Simulation algorithm of  
To obtain the numerical results described, we have carried out a large-scale simulation campaign. Since all the processes in our model are stationary in nature, our system is in a stationary state. All data were collected by averaging the results of the experiments. In each scenario, at least 10,000 experiments were carried out to obtain the data for statistical processing. To obtain the statistical estimates, we utilized the batch means method [32]. In what follows, we demonstrate only point estimates of the metrics of interest. The reason is that, in each experiment, we collect a sufficient number of batches so that the confidence intervals do not deviate from the point estimates by more than 1% at a significance level of \(\alpha=0.05\).