# An Adaptive Delay-Tolerant Routing Algorithm for Data Transmission in Opportunistic Social Networks
## Appendix A The Details of Curve-Trapezoid Mamdani Fuzzy Inference System
### The Fuzzy Component  
As a regular component in the Mamdani fuzzy inference system, the fuzzier determines the specific membership degree of the two-factor fuzzy input (two-factor fuzzy inputs) by determining different membership functions. According to the trichotomy law from the Mamdani fuzzy inference system [24], three different levels of membership degrees for each fuzzy input can be determined by three different levels of membership functions: low membership function, medium membership function, and high membership function. Different levels of membership functions can determine the influence of each fuzzy input on the data transfer decision to different degrees of importance. There are many different reference models that can be adopted in different application scenes in control engineering theory, such as the normal distribution, the \(F\) distribution, and the parabolic distribution, and so on. [13; 21]. As the remaining energy or cache is below a certain lower limit, the node may be dead or unable to move; and these two values must be below a network adaptable upper limit, so the two-factor fuzzy inputs follow a half trapezoid or trapezoid distribution. To this end, curve trapezoid membership function will be utilized to compute the membership degree of the two-factor fuzzy inputs [23; 25] in the proposed improved fuzzy system, namely Curve-trapezoid Mamdani Fuzzy Inference System (CMFI). The traditional trapezoidal distribution membership function is linear, but that proposed in this paper is curvilinear, which is favorable for expressing the smooth relationship between two-factor input and data transmission. As demonstrated in Figure 1, the remaining cache and energy level are defined as the two-factor fuzzy input of CMFI system, the domain of which can be regarded as \(U_{f}\)= \(\{L_{(node_{i},\Delta t)}^{re},L_{(node_{j},\Delta t)}^{re}\}\) and \(U_{f}\in(0,1]\). to express fuzzy input concisely, the two-factor fuzzy input values (the remaining cache level and energy level) can be formalized as the following Equation (A1), in which \(x_{1}^{node_{i}}\) and \(x_{2}^{node_{i}}\) represent the remaining energy level and the remaining cache level from the \(node_{i}\), respectively. \[x_{j}^{node_{i}}=\left\{ \begin{array}{ll}L_{(node_{i},\Delta t)}^{re}\;j=1 \\ L_{(node_{i},\Delta t)}^{re}\;j=2\end{array} \right.\] (A1)  
Then the domain of factor subset, also namely factor subset, can be transformed as. For a fuzzy subset \(\widetilde{A}\) from a given domain \(U_{f}\), a fuzzy mapping from \(U_{f}\) to an interval \((0,1]\) can be represented by \(\mu_{\widetilde{A}}\) : \(U_{f}\rightarrow(0,1]\), where \(\mu_{\widetilde{A}}\) is a membership function that corresponds to the fuzzy set \(\widetilde{A}\). Therefore, a fuzzy inference mapping from the domain \(U_{f}\) to the interval \((0,1]\) can be represented by:  
\[x_{j}^{node_{i}}\mapsto\mu_{\widetilde{A}}(x_{j}^{node_{i}})\in(0,1]\;(j=1,2)\] (A2)  
Obeying the rule of trichotomy law in Mamdani fuzzy inference system, the fuzzy subsets from the given domain \(U_{f}\) could be defined as three different levels including low, medium, and high, the combination of which \(F(U_{f})\), namely fuzzy power set or evaluation subset, can denoted as  
\[F(U_{f})=\widetilde{A}(x_{j}^{node_{i}})=\left\{\widetilde{A}_{low},\widetilde {A}_{medium},\widetilde{A}_{high}\right\}\] (A3)  
where \(\widetilde{A}_{low},\widetilde{A}_{medium},\widetilde{A}_{high}\) represent low, medium and high levels of membership subsets from two-factor fuzzy input, respectively. In fuzzy set theory, except that the membership degree is 1 and 0, belonging and not belonging have no clear meaning, so the fuzzy power set can be computed by:  
\[F(U_{f})=\left\{\widetilde{A}\right|\mu_{\widetilde{A}}:U_{f}\rightarrow(0,1]\right\}\] (A4)  
From the perspective of mathematical theory, \(F(U_{f})\) is a mapping from the domain \(U_{f}\) to the an interval \((0,1]\).