## 5 Proposed Adaptive Beaconing System
### Characterization of Node Distribution
#### 5.2.3 Defuzzification  
The defuzzification process uses the center of gravity (COG), a widely adopted method in real applications. The output membership function, demonstrated in Figure 10, represents the preliminary congestion rank which is related to Fuzzy Rule Set 3 only. The output membership function, shown in Figure 11, represents the final congestion rank for all fuzzy rule sets. High congestion ranks require lower beacon rates. Rate Control Mechanism  
Once the fuzzy logic system provides the congestion rank, the rate control function in our protocol determines the next beacon rate (\(NBR\)) by adjusting the current beacon rate (\(CBR\)) through the use of Equation (8). \[NBR= \begin{cases}CBR+2*step\,size,&Very\,Low\\ CBR+step\,size,&Low\\ CBR,&Medium\\ CBR-step\,size,&High\\ CBR-2*step\,size,&Very\,High\\ \end{cases}  \tag{8}\]  
The final step is to send the beacon at the new rate (\(NBR\)). Algorithm 1 outlines the procedure of the HACEAB protocol. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Rule Number**} & **Preliminary** & **Number of** & **Highly** & **Final** \\  & **Congestion** & **Rank** & **Neighbors** & **Mobility** & **Congestion** \\ \hline
9 & Small & Big & Low & Medium \\ \hline
10 & Medium & Small & High & Small \\ \hline
11 & Medium & Small & Medium & Medium \\ \hline
12 & Medium & Small & Low & Medium \\ \hline
13 & Medium & Medium & High & Medium \\ \hline
14 & Medium & Medium & Medium & Medium \\ \hline
15 & Medium & Medium & Low & Big \\ \hline
16 & Medium & Big & High & Medium \\ \hline
17 & Medium & Big & Medium & Big \\ \hline
18 & Medium & Big & Low & Big \\ \hline
19 & Big & Small & High & Medium \\ \hline
20 & Big & Small & Medium & Big \\ \hline
21 & Big & Small & Low & Big \\ \hline
22 & Big & Medium & High & Big \\ \hline
23 & Big & Medium & Medium & Very Big \\ \hline
24 & Big & Medium & Low & Very Big \\ \hline
25 & Big & Big & High & Very Big \\ \hline
26 & Big & Big & Medium & Very Big \\ \hline
27 & Big & Big & Low & Very Big \\ \hline \hline \end{tabular}
\end{table} 
Table 5: _Cont._```
1:Use the default beacon rate
2:Receive beacons from other vehicles
3:Determine the number of direct neighbors \(ND\)
4:Calculate the density threshold \(DT\) = (1000/(CCHI + SCHI))*(CCHI-GI)*BL*(1/BR)
5:if\(ND\) > \(DT\)then
6: Use Set 3's parameters
7:else Initialize \(n_{m}=0\) for \(m=[0,N]\)
8: Generate random point x,y within the nodes' transmission range
9: Set \(m=0\);
10:if The node itself or neighboring node is within R/5 of x,y then
11: Increment \(m\)
12:endif
13: Increment \(n_{m}\)
14: Repeat steps 9-14 30 times
15: Calculate the quadrat value \(Q=V[n]/E[n]\)
16:if\(Q>1\)then
17: Use Set 1's parameters
18:else Use Set 2's parameters
19: Fuzzify the crisp input
20: Trigger the inference engine and use the selected set fuzzy rules
21: Defuzzify and get the final congestion rank
22: Calculate the next beacon rate (NBR)
23: Send a beacon at the new rate
24:endif
25:endif
```

**Algorithm 1** HACEAB protocol. ### Transmission Power Adaptation

HACEAB further enhances performance by adjusting the transmission power according to the network density and node distribution. The network density status and node distribution are very important aspects to look at when a protocol needs to adjust its transmission power. Using the density estimation function and the quadrat method explained earlier, HACEAB adapts the transmission power. After getting the density status (dense or not dense) from the density estimation function, if the density status is dense, the new transmission power (\(NTP\)) is equal to the current transmission power (\(CTP\)) decreased by one step size, because in that case, we need to exclude more nodes to reduce the congestion. In case of nondense conditions, HACEAB determines the spatial distribution of vehicles using the quadrat method. If the quadrat value is more than 1, it means that the vehicles are clustered in a 1D-oriented uniform distribution.