## 3 System Design and the Proposed HPR-DCC Methodology
### Proposed HPR-DCC Algorithm  
Algorithm 1 outlines the steps of the proposed HPR-DCC, a hybrid power and rate control DCC algorithm that can dynamically adjust the transmission power and rate of vehicular communication systems. The transmission power control component of the proposed HPR-DCC assigns appropriate transmit power to neighboring vehicles that were already connected to the node in the previous time step. This assignment is based on the current path loss and path loss exponent. If vehicles are not neighbors in the previous time step, a default value is used as the transmission power. The HPR-DCC then sorts these power values in ascending order and selects the smallest value that meets the target awareness percentage as the next \begin{table}
\begin{tabular}{c c c c} \hline
**State** & **CBR vs. Target** & **PL vs. Target** & **Tx Power (t + 1)** \\ \hline
1 & \(<\) & \(<\) & Apply \(P_{r}(t+1)\) \\
2 & \(<\) & \(\geq\) & Apply \(P_{r}(t+1)\) \\
3 & \(<\) & \(<\) & Apply \(P_{r}(t+1)\) \\
4 & \(<\) & \(\geq\) & Apply \(P_{r}(t+1)\) if \(\leq P_{r}(t)\) \\
5 & \(>\) & \(<\) & Apply \(P_{r}(t+1)\) if \(\leq P_{r}(t+1)\) \\
6 & \(>\) & \(\geq\) & Apply \(P_{r}(t+1)\) if \(\leq P_{r}(t)\) \\
7 & \(>\) & \(<\) & Apply \(P_{r}(t+1)\) if \(\leq P_{r}(t)\) \\
8 & \(>\) & \(\geq\) & Apply \(P_{r}(t+1)\) if \(\leq P_{r}(t)\) \\ \hline \end{tabular}
\end{table} 
Table 1: State switching strategies of state machine. transmission power. In terms of rate control, the HPR-DCC adjusts the communication rate according to the current channel load (CBR), which is calculated as the ratio of received messages to the channel capacity. The state machine rate control mechanism can also adjust to diverse congestion scenarios and assign suitable transmission rates to vehicles. To maintain efficiency, the power and rate control decisions collaboratively \"share the load\" under high CBR conditions. The balancing of this relationship between the target and current beacon rate and awareness is determined by the coefficient \(\gamma\), which is currently set to 1. That means the Tx power and Tx rate share the equal weight. The coefficient \(\gamma\) will be utilized to effectively coordinate the control module in this context. When the detected transmission power error rate \(\delta_{P}\) surpasses the transmission rate with the coefficient \(\gamma\delta_{R}\), a higher level of transmission power will be employed as a means to alleviate it. Conversely, if the detected transmission power error rate with coefficient \(\gamma\delta_{R}\) is below the transmission rate, the current transmission power level will be maintained without any adjustment. ```
1:Neighbor transmission power detection
2:Calculate\(PL(t)=P_{t}^{Tx}(t)-P_{t}^{Rx}(t)\)
3:\(\mathit{PLE}_{ij}(t)=\frac{P_{t}(t)}{10\log_{\text{tot}}(\frac{\text{i}d}{ \text{i}}d(t))}\)
4:if\(Neighbor_{r\to i}(t)\in Neighbor_{r}(t-1)\)then
5:\(P_{r}(t)=\frac{B_{r}G_{r}G_{r}}{PL(t)}\)
6:else
7:\(P_{\mathit{Sorted}}{}^{Tx}=\mathit{sort}_{ \begin{subarray}{c}i,j\in N \end{subarray} }(P_{r}(t+1))\)
8:\(P_{r}(t+1)=P_{\mathit{sorted}}{}^{Tx}[round(\mathit{TA}_{e}*N)]\)
9:Congestion detection process
10:Sensed busy if\(\sum P_{ri}>S_{\mathit{busy}}\)then
11:Record \(T_{\mathit{busy}}\)
12:Calculate CBR every \(T_{\mathit{CBR}}=100\) ms
13:CBR = \(T_{\mathit{busy}}/T_{\mathit{CBR}}\)
14:Transmission power allocation
15:if\(\mathit{CBR}(t)<\mathit{CBR}_{\mathit{Th}}\)then
16:Apply \(P_{r}(t+1)\)
17:else
18:if\(P_{r}(t+1)\leq P_{r}(t)\)then
19:Apply \(P_{r}(t+1)\)
20:Transmission rate allocation
21:ifNew Tx power apply then
22:State switching Active
23:else
24:Keep default Tx rate
25:Coordinated Control Module
26:Calculate error rate of Tx Power and Tx Rate
27:\(\delta_{P}=P_{R}(t)-\mathit{PLE}_{R}(t)\)
28:\(\delta_{R}=\frac{TR(t)-\mathit{BR}(t)}{TR(t)}\)
29:if\(\delta_{P}\geq\gamma\delta_{R}\)then
30:Apply \(P_{r}(t+1)\)
31:if\(\delta_{P}<\gamma\delta_{R}\)then
32:Keep Tx power the same
```  
**Algorithm 1**Hybrid Power and Rate Control DCC algorithm.