# A Resource Oriented Route Selection Framework Using Contextual Information Based on Fuzzy Logic
## 4 Proposed Approach
### Combining of Routing Metrics  
The objective function that is based on the single metric may not entirely meet the requirements of the diverse applications. We have defined three routing metrics to consider in COOF design. With COOF, each node can select a preferred parent (optimal path) based on context information that was obtained from the application. Each metric describes the important attributes of a neighbor node that can serve as a parent. Therefore, these attributes contributing to the formation of a path towards the root. In the parent selection problem, we use the fuzzy logic technique as a decision-making framework. The use of intelligent computing to support decision making is widely used in recent studies in the low power and lossy networks. For IoT based smart city application requirements, our proposed OF determines the best parent from the candidate parent set in an efficient way using the fuzzy logic technique. The basic concept of fuzzy logic system is that a variable can belong to a set that lies between true and false. Instead of using numerical values, a linguistic variable is an input or output variable whose value is a word or sentence. For example, in our proposition, as input, the linguistic variable of the ETX metric is a member of three sets according to the information that was obtained at a node through a DIO message: '_Short_', '_Average_', and '_Long_'. Figure 4 shows the membership function for the fuzzy variable ETX. In general, the membership value for the respective fuzzy variable is determined based on several trialing [39]. Simulation tests determine the minimum, maximum, and average values of these variables experimentally. The key  
points of the membership function can be computed based on the upper limit of the network criterion. In this work, the maximum ETX value is determined as 15. As depicted in Figures 4-6, the fuzzy values are computed through the membership functions of the fuzzifier. For Instance, if the ETX value in DIO is 3, and then the corresponding membership value of ETX variable is [1, 0, 0]. ETX is the member of three set {_Short_, _Average_, _Long_} \(\rightarrow\) {1, 0, 0}. Accordingly, the ETX value 3 can be only considered in _'Short'_ set. Similarly if the ETX value in DIO is 4.5, then the membership value is [0.50, 0.50, 0] \(\rightarrow\) {_Short_, _Average_, _Long_}. In this case, ETX value 4.5 can be considered in _'Short'_ and _'Average'_ set. The _ETX_ value that lies between 6 and 9, the membership function is of 1, which is [0, 1, 0] and considered in _'Average'_ set. Likewise, if the ETX value is 10, then the corresponding membership value is [0, 0.65, 0.35]\(\rightarrow\) {Short, Average, Long}. Here, the ETX value 10 can be considered in _'Average'_ and _'Long'_ set. The same reasoning holds for any other ETX value. In this way, QFI and REI are classified into three linguistic variables, as shown in Figures 5 and 6. The membership functions of a fuzzy logic system are used to quantify the linguistic relations. Numerous membership function, such as sigmoid, Gaussian, and triangular, are defined in the fuzzy system to be used in the fuzzification and defuzzification process [39]. However, the most common form of membership used in fuzzy system is trapezoidal. The membership function relates the value in  
Figure 4: Input variable of expected transmission count (ETX). The variable represents the link quality of a path. Figure 5: Input variable of queue fluctuation index (QFI). The variable represents the resource availability in a path. Figure 6: Input variable of residual energy index (REI). The variable represents the energy level of the nodes in a path. the interval of [0-1] and it is computed by the membership function.