# An Adaptive Delay-Tolerant Routing Algorithm for Data Transmission in Opportunistic Social Networks
## 3 System Model Design
### The Frame of Adaptive Curve-Trapezoid Mamdani Fuzzy Inference and Decision-Making System  
The limited energy and cache are two severe challenges for opportunistic networks. However, few routing algorithms consider the combined impact of the two factors on data transmission. Besides, most routing protocols tackle this issue from a deterministic perspective, which can be formalized as a linear or nonlinear mathematical expression. On the contrary, the relationship between the data transmission and two-factor (energy and cache) is in actuality a type of fuzzy uncertain relationship, while should be defined as the level of membership in a fuzzy system. Therefore, we propose an adaptive two-factor data transmission algorithm based on CMFI. As shown in Figure 1, a numerical comparison is an intuitive way for message carrier or source node to make decisions on data transmission, but it neither discovers the impact of variable change on data transmission, nor distinguishes the influence degree on data transmission between different factors. Therefore, the CMFI system has been considered as a significant approach to achieve the above two goals. In this section, we will introduce the overall structure of the CMFI step by step, as follows:Step 1: to accurately determine the pattern recognition of data transmission capability of nodes, CMFI system obeys the tripartite method rule from Mamdani fuzzy inference system [37; 38], thereby developing three levels of membership functions (low membership function, medium membership function, and high membership function) and the corresponding three levels of fuzzy subsets for each fuzzy input.  
Step 2: the nodes in opportunistic social networks are defined as message users who carry several mobile devices, and two-factor fuzzy input could be regarded as fuzzy factor set from CMFI. The message carriers collect two-factor fuzzy input from their neighbor nodes and compute membership degrees for each of fuzzy inputs based on three levels of membership functions (low, medium, and high). In addition, three levels of fuzzy subsets (low, medium, and high) are determined by the three levels of membership functions.  
Step 3: with the support of 'If-Then' fuzzy rules [36], there are nine different combination that can be generated from fuzzy subsets between the first-fuzzy and second-fuzzy inputs. These nine various combinations reflect nine levels of data processing from nodes, respectively. Besides, neighbor nodes of message carriers are divided into three categories: active next-hop, potential next-hop, and under-resourced next-hop.  
Step 4: Due to the specificity of two-factor fuzzy input, CMFI is employed to evaluate the impact of two-factor fuzzy input on the data transmission in opportunistic social networks. The abscissa and ordinate in each of the six membership degrees could produce a closed area with the corresponding level of membership function. The final control result can be acquired from the overlap of these six areas based on the centroid method [38].  
Step 5: Through systematic and artificial parameter adjustment, CMFI can optimize the fuzzy control result, which provides support to node classification and to make data transmission more suitable and reliable in opportunistic social networks.  
To this end, after the above five interconnected steps, message carriers can evaluate the ability of data storage and routing of neighbor nodes by calculating and comparing their fuzzy control result, thereby continuously optimizing node classification and the selection of the next-hop in the routing table of message carriers.  
Figure 1: The overall structure of the curve-trapezoid Mamdani fuzzy inference system.