## 5 Proposed Model
### Fuzzy-Logic Based Movement Decision
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**N\_Id** & **Type** & **Neighbours\_\#** & **Neighbours\_Ids** & **Neighbours\_Types** & **Neighbours\_RSSI** \\ \hline
20 & 0 & 3 & \(48,147,226\) & \(0,0,0\) & \(-89.92,-57.91,-82.44\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Node’s Neighbours Table. Trapezoidal membership function is like the Triangular function with a flat top. It is formed as  
\[\mu_{A2}(x)= \begin{cases}0&x\leq a2\\ \dfrac{x-a2}{b2-a2}&a2\leq x\leq b2\\ 1&b2\leq x\leq c2\\ \dfrac{d2-x}{d2-c2}&c2\leq x\leq d2\\ 0&d2\leq x\end{cases}  \tag{5}\]  
As in [31; 32], we used the triangular function for the middle variables while the trapezoidal member function was used for the boundary variables. The values used in both the Triangular and the Trapezoidal membership functions are shown in the following Table 4.  
Figure 3 illustrates the inputs functions and degrees of relationship of FLPPL, Figure 3a the RSSI level input, Figure 3b the number of neighbours input and Figure 3c the distance to each neighbour input. The correlations between each two input functions and the output can be represented as a three-dimensional curve. The following surface plots in Figure 4, depict the correlations between the fuzzy inputs in our FLPPL approach, starting with the Distance to RSSI as in Figure 4a, Distance to Neighbours in Figure 4b and Neighbours to RSSI in Figure 4c. \begin{table}
\begin{tabular}{c c c} \hline \hline
**RSSI** & **Neighbours** & **Distance** \\ \hline Weak: [\(-102\)\(-100\)\(-90\)\(-70\)] & Low: [\(-0.5\)\(0\)\(6\)\(8\)] & Near: [\(-0.25\)\(0\)\(3.125\)\(6.25\)] \\ Medium: [\(-90\)\(-70\)\(-30\)] & Medium: [\(6\)\(8\)\(12\)] & Medium: [\(3.125\)\(6.25\)\(9.375\)] \\ Strong: [\(-70\)\(0\)\(2\)] & High: [\(8\)\(12\)\(25\)\(25.5\)] & Far: [\(6.25\)\(9.375\)\(12.5\)\(12.75\)] \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The values of membership functions in FLPPL. Figure 3: _Cont._  
The system output function in our model is identified as the chance (probability). The chance represents the probability of the MA's next point from the current location. The MA will move  
Figure 4: Relationship among fuzzy inputs of FLPPL, (**a**) distance vs. RSSI, (**b**) Distance vs. Number of Neighbours, (**c**) Number of Neighbours vs. RSSI. The darker the color is, the lower the chance is. Figure 3: Inputs functions and degrees of relationship of FLPPL, (**a**) the RSSI level input, (**b**) the number of neighbours input and (**c**) the distance to each neighbour input. to the closest point in distance to the higher chance node. For example, consider the three nodes (N_ids = 1, 2 and 3) shown in Figure 5. The MA current location is in the center of the hexagon, which by default means that the next movement will be to a corner of the hexagon. Now, the MA will contact each node, exchange their information and analyze it. Using the fuzzy-logic model, the MA will estimate each node's chance considering the three membership function inputs. While still taking into account the rules of constraints described in Section 5.1, the MA will move to the closest point (in green) to the highest chance node (N_id = 2 in the example). Nine output degrees are defined in this system similar to those used in [31]. They range from (very weak) as the lowest degree to (very strong) as the highest one. Table 5 shows the output function along with the nine membership functions. Any fuzzy-logic system depends on the IF-Then rule statements that are used to formulate the conversion from the input functions to the output one. A simple fuzzy IF-Then rule is stated as  
\[\textit{if}\ x\textit{ is }A,\textit{ then }y\textit{ is }B \tag{6}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Output** & **Membership Functions** \\ \hline \multirow{6}{*}{Chance} & Very Weak \\  & Weak \\  & Little Weak \\  & Little Medium \\ \cline{1-1}  & Medium \\ \cline{1-1}  & High Medium \\ \cline{1-1}  & Little Strong \\ \cline{1-1}  & Very Strong \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Output functions.