## 7 Simulation Setup  
WBANs are smart wireless medical monitoring networks interlaced by wearable and implantable medical devices over the human subject. For the WBAN, device spectrum longevity is a main challenge due to the inadequacy in the availability of dedicated licensed PU channels to the IP-BNC. Thus, we proposed an optimized dynamic channel allocation algorithm. The effective EFPOC channel allocation algorithm deployment strategy to the OP-IMD can influence the network lifetime eminently. Table 3 gives the following simulation setup parameters made in NS2 software [24]. The WBAN transmitter (BNC), receiver (APs), and the energy level are measured for dynamic channel selection. The number of channels in allocation for the idle PUs to the OP-BNC is varied, and their energy \begin{table}
\begin{tabular}{c c c c} \hline
**No.** & **Operation** & **Complexity** & **Total** \\ \hline
1. & i = 0, S = 0, t = 0, initialize random parameters & 0 & t* \\ \hline
2. & & n* \\ \hline \multicolumn{3}{c}{**while (t \(<\) G)/iteration/**/** 1} & n*1 \\ \hline \multicolumn{3}{c}{**for (I = 1; I \(<\) S; i++)/**channel size/** \(\text{S}^{*}\)(1 + n)**} & Sn + Sn\({}^{2}\) \\ \hline \multicolumn{3}{c}{rand = RNG (0,1)} & 1 & n*1 \\ \hline \multicolumn{3}{c}{**Sn\({}^{2}\) + Sn + 2n**} \\ \hline
3. & & n* \\ \hline \multicolumn{3}{c}{**if (rand \(>\) p)/**global channel search/**/** 1} & n*1 \\ \hline \multicolumn{3}{c}{\(Z_{t}^{p+1}=Z_{t}^{p}+\text{H}\big{(}\mathbf{b},-Z_{t}^{p}\big{)}\)} & 3 & n*3 \\ \hline \multicolumn{3}{c}{H = (\(\lambda\) I(\(\lambda\)) sin(\(\pi\lambda\)/2)/\(\pi\)*(1/SZ (1+\(\lambda\))))} & 3 & n*3 \\ \hline \multicolumn{3}{c}{**7n**} \\ \hline
4. & & n* \\ \hline \multicolumn{3}{c}{**else/**local channel search/**/** } \\ \hline \multicolumn{3}{c}{\(\varepsilon\) = RNG (0,1)} & 1 & n*1 \\ \hline \multicolumn{3}{c}{\(Z_{t}^{p+1}=Z_{t}^{p}+\varepsilon\left(Z_{\gamma}^{p}-Z_{\text{S}}^{p}\right)\)} & 3 & n*3 \\ \hline \multicolumn{3}{c}{**4n**} \\ \hline
5. & & n* \\ \hline \multicolumn{3}{c}{**for (I = 1; I \(<\) S; i++)**} & S*(1 + n) & Sn + Sn\({}^{2}\) \\ \hline \multicolumn{3}{c}{**if (\(Z_{t}^{p}\)\(>Z_{t}^{p+1}\))**} & 1 & n*1 \\ \hline \multicolumn{3}{c}{b, = \(Z_{t}^{p}\) /current best/**/** } & 0 & 0 \\ \hline \multicolumn{3}{c}{**Sn\({}^{2}\) + Sn + n**} \\ \multicolumn{3}{c}{**n\({}^{*}\)**} \\ \hline
6. & **else** & \\ \hline \multicolumn{3}{c}{\((Z_{t}^{p}=Z_{t}^{p})\), \((Z_{t}^{p}=Z_{t}^{p+1})\)} & 0 & 0 \\ \multicolumn{3}{c}{\((Z_{t}^{p+1}=Z_{t}^{p})\), b, = \(Z_{t}^{p}\)} & 0 & 0 \\ \hline
7. & t++ & n & n \\ \hline \multicolumn{3}{c}{\(\text{Sn}^{2}+\text{Sn}+n+n+4n+\gamma_{n}+\)} \\ \multicolumn{3}{c}{Total complexity, O(n):} & \multicolumn{3}{c}{Sn\({}^{2}+\text{Sn}+2n\)} \\ \multicolumn{3}{c}{\(\sim\)2 Sn\({}^{2}+2\text{Sn}+15n\)} \\ \multicolumn{3}{c}{\(\sim\)n\({}^{2}\)} \\ \hline \end{tabular}
\end{table} 
Table 2: Algorithm Complexity. levels are obtained. Figure 7 shows the stimulated output of the number of channels scanned and the allocation of idle dynamic channel selection to the increased OP-BNC patients. The ranking method [9] takes nearly 81 ms to scan all the idle channels and allocate them to find the two idle channels to allocate to the patients, where the EFPOC takes 63 ms to scan and allocate the two channels to the required users. When the number of channels scanned is increased and the idle channel is linearly increased to twenty numbers, the proposed EFPOC algorithm takes 410 ms, but the existing algorithm takes 435 ms to complete the process of scanning, selecting, and assignment. An overall value of 25% time improvement is achieved by the EFPOC dynamic channel section algorithm The above analysis and calculations are the overall time and the total number of channels evaluated and the simulated results. The assignment of channels to the increasing OP-BNC is attended by the SUs, and to provide a steady channel, the idle PUs are allocated by the EFPOC algorithm.