## 4 Results
### Knowledge Base Distribution and Robustness Tests
#### 4.2.1 KB Distribution in Real Scenarios  
The real-world application where the KBs distribution was performed was described in a previous study [6]. We presented a knowledge-based WSN that concretely modeled a system of olive tree pests. The development of the olive tree fly is closely related to the temperature and humidity conditions of the environment. The suitability of insecticide treatment applications should be evaluated if the risk of the plague's appearance in an area surpasses a threshold level. The KBs were designed previously using an XML file that can have any number of variables, fuzzy sets, or rules; this file is validated with a Document Type Definition (DTD). Nevertheless, this file is not sent to sensors due to the presence of characters unrelated to later processes in the sensors. Therefore, this file is parsed in the host before sending it. The format is similar to a binary serialization of the values of interest to the KB, such as variable ids or point coordinates. Five experiments were completed in the knowledge-based WSN, one for each of the five WSN layouts. The first WSN used only one Sun SPOT, just the final recipient, while the others used 2 more intermediate sensors for each experiment with a maximum of nine. In all cases the same base station was used, and the distance between motes was about 10 meters. The layout of the WSN was approximately linear, where every mote had only two motes within its range, the previous and the next in the line. The intermediate motes between the base station and the final mote work like mesh routers, and the final mote implements the application protocol. In our experiment, we sent the three different KBs listed in Table 2. For each KB thirty tests were done. The results obtained were the round trip time (RTT) values in milliseconds which include the answer from the sensor for each experiment. Table 3 lists the lower and upper limits of the \"confidence interval\". In 95% of the cases the \"expected value\" will be between the stochastic endpoints calculated for this confidence interval, but in 5% of the cases it will not be due to route re-calculation in the intermediate motes. Figure 5 shows the average values obtained for the transmission of every KB. \begin{table}
\begin{tabular}{l c c c} \hline  & **Kb1** & **Kb2** & **Kb3** \\ \hline Input variables & 3 & 2 & 4 \\ Output variables & 1 & 1 & 1 \\ Fuzzy sets & 12 & 7 & 13 \\ Rules & 2 & 1 & 5 \\ KB size (bytes) & 332 & 492 & 740 \\ \hline \end{tabular}
\end{table} 
Table 2: Knowledge base details. Figure 5 shows that the size of the KB is an important parameter and that the number of nodes makes the RTT grow as it was supposed. Nevertheless, the confidence interval is short because the deployed network is static and, once the route is calculated, it has no changes until the route expires in the intermediate nodes. In order to prove the hypothesis that the delay increases with the number of hops and the size of KBs, a statistical analysis, a t-student test, was done to the average values obtained. The test checks if the differences in the delay average measures were significant for the different numbers or hops and sizes of the KB. A significance level \(\alpha=0.05\) was applied for the test in question. Table 4 shows the results of two experiments; the first of them, \"Experiment A\", tests the significance of the increase of the delay for the same number of hops with different KBs, whereas \"Experiment B\" tests the \begin{table}
\begin{tabular}{c c c c} \hline
**Hops** & **KB1 (ms)** & **KB2 (ms)** & **KB3 (ms)** \\ \hline
1 & 453.01–462.57 & 576.87–593.06 & 757.27–770.22 \\
3 & 723.33–749.18 & 918.61–964.12 & 1184.8–1226.8 \\
5 & 921.86–964.41 & 1067.23–1117.63 & 1482.5–1542.1 \\
7 & 993.20–1050.50 & 1176.43–1228.19 & 1586.3–1655.6 \\
9 & 1030.20–1136.91 & 1247.67–1297.75 & 1670.6–1746.8 \\ \hline \end{tabular}
\end{table} 
Table 3: RTT distribution of KBs interval in which the probability of meeting the parameter “expected value” is 0.95. Figure 5: Average RTT values of the distribution of KBs.