# A Reinforcement-Learning-Based Distributed Resource Selection Algorithm for Massive IoT
## 6 Performance Evaluation
\begin{table}
\begin{tabular}{l l} \hline \hline
**Test Scenario** & **Details** \\ \hline \(Ld=(0,0,0)\) & No externally-offered load added \\ \hline \(Ld=(0,2,3)\) & Two IEEE 802.15.4e IoT devices operating on CH50 are added, and three \\  & IEEE 802.15.4e IoT devices operating on CH56 are added \\ \hline \(Ld=(0,1,4)\) & One IEEE 802.15.4e IoT device operating on CH50 is added, Four IEEE \\  & 802.15.4e IoT devices operating on CH56 are added \\ \hline \(Ld=(0,0,5)\) & Five IEEE 802.15.4e IoT devices operating on CH56 are added \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Externally-offered load added in the experiment environment. Second, because it was important for the IoT devices to send the data frames unbiasedly, the well-used [PERSON]'s fairness index (FI) (see Equation (14)) for the data transmission of the IoT devices was measured. \[FI(p^{1},p^{2},...,p^{M})=\frac{(\sum_{j=1}^{M}p^{j})^{2}}{M\sum_{j=1}^{M}(p^{j} )^{2}} \tag{14}\]  
where \(M\) is the number of devices and, accordingly, \(j\) is the index of device, while \(0\leq FI\leq 1\), A larger value represents a more reasonable frame transmission achieved by the IoT devices. Figure 10 shows the results of the FIs of the cognitive-IoT prototypes and EA IoT devices. As shown in Figure 10, the FI values of both the cognitive-IoT prototypes and EA IoT devices were nearly one when all the available channels were equivalently \"idle\", i.e., _Ld_: (0, 0, 0). However, for the other test scenarios, i.e., _Ld_: (0, 2, 3), _Ld_: (0, 1, 4), and _Ld_: (0, 0, 5), the FI values of the EA IoT devices decreased because some of the EA IoT devices failed to send the data frames owing to channel congestion, whereas some of them can do this successfully This led to unfairness in the EA IoT devices. By contrast, in all the test scenarios, the FI values of the cognitive-IoT prototypes were typically kept nearly one. Figure 10: FI results. Figure 9: Frame Successful Ratio (FSR) results. Furthermore, for validating that the cognitive-IoT prototypes adaptively selected the channels, in the experiments, the number of successful frame transmissions over each available channel was observed. We initiated the experiment with test scenario _Ld_: (0, 0, 0) and then changed the test scenarios in the middle of the experiment, i.e., testing _Ld_: (0, 0, 5) for 10 min, _Ld_: (0, 1, 4) for 15 min, _Ld_: (0, 2, 3) for 15 min, and _Ld_: (0, 0, 0) for 15 min subsequently (see Figure 11). The results were tracked and are shown in Figure 11. It can be observed from Figure 11 that the number of successful frame transmissions over the CH56 decreased to almost zero immediately after the test scenario changed to _Ld_: (0, 0, 5) when an externally-offered load was added to CH56. In addition, it is observed from Figure 11 that the cognitive-IoT prototypes started to select CH56 again when the externally-offered load became lighter, i.e., _Ld_: (0, 1, 4) and _Ld_: (0, 2, 3), than before, i.e., _Ld_: (0, 0, 5). It can be stated that the cognitive-IoT prototype achieved selecting the optimal channel accurately and adaptively.