## 5 Methodology
### Fuzzy Logic Based Pricing Strategy
#### 5.1.2 Fuzzification and Fuzzy Rules  
The membership function defines the way that each value in the input space can be mapped to a membership value within the range of \([0,1]\), which is the membership degree. Membership functions are designed by dividing each linguistic variable into an overlapping fuzzy set, which is obtained through experiments. A set of membership functions for each fuzzy variable can be expressed as:  
\[Z_{F}=\{(y,\mu_{Z}(y)):y\in Y,\mu_{Z}(y)\in[0,1]\}, \tag{15}\]  
where \(\mu_{Z}(y)\) is the membership function of \(Z\), it also indicates the degree at which \(y\) belongs to \(Z\). The \(Y\) refers to a universe of discourse.  
In this work, two membership function sets are designed in a triangular format due to their low complexity and flexibility, based on the input and output variables. The triangular membership function can be expressed as follows:  
\[\mu_{Z}^{tri}(y)=\begin{cases}\begin{array}{ccc}0,&\text{if}&y<a\\ \dfrac{y-a}{b-a},&\text{if}&a\leq y\leq b\\ \dfrac{c-y}{c-b},&\text{if}&b\leq y\leq c\\ 0,&\text{if}&y>c\end{array},\end{cases} \tag{16}\]  
where \(a\) denotes the lower bound of the triangular curve, \(b\) denotes the modal value of the triangular curve and \(c\) denotes the upper bound of the triangular curve.  
Figure 2a exhibits the survey of the input membership functions of \(w_{j}(t_{0})\), \(d_{uj}(t_{0})\), \(v_{uj}(t_{0})\), and \(f_{j}(t_{0})\), and Figure 2b defines the membership function of \(r_{uj}(t_{0})\). Meanwhile, \"Low\", \"Medium\" and \"High\" are used to represent the pricing fuzzy sets of each metric. The fuzzy rules are defined based on the if-then logical operation, and each rule represents a fuzzy implication between a condition and a conclusion. An output can only be obtained after evaluation of the fuzzy rules, thus the design of the fuzzy rules is criti  
cal for the final performance. In this work, the fuzzy rules are designed based on the following considerations:  
* \(w_{j}(t_{0})\): A vehicle will be proactive to participate in the offloading cooperation if it is in poor financial condition, thus it will asks a low price to lure the UV to choose it as the final SV. On the contrary, a vehicle will not be interested in the cooperation if it has good financial situation, and it will asks a high price.
* \(d_{uj}(t_{0})\): Since the communications quality is inversely proportional to the distance between two vehicles, a large distance represents a poor transmission quality, thus a high price for cooperation, and vice versa.
* \(v_{uj}(t_{0})\): The communications quality is inversely proportional to the relative speed between two vehicles, thus a large relative speed represents a poor transmission quality, thus a high price for cooperation, and vice versa.
* \(f_{j}(t_{0})\): To fully utilize the idle resources on nearby vehicles, the designed pricing model promotes vehicles with a small volume of resources. As a result, when a vehicle has a small amount of computing resources, it will lower the price to competing for serving as a SV, and vice versa.
* \(r_{uj}(t_{0})\): The communications quality is proportional to the link reliability between two vehicles, thus a high link reliability represents a good transmission quality, thus a low price for cooperation, and vice versa.  
Each of the five input fuzzy variables has three fuzzy sets, so there are \(3^{5}=243\) fuzzy rules in total. The more fuzzy sets, the more fuzzy rules, and the more details can be described. However, a large number of fuzzy sets advances the difficulty of making fuzzy rules and thus increases the calculation complexity. Therefore, it is important to find an appropriate number of fuzzy sets to strike a balance between the precision demand and the complexity. Based on the above considerations, we can obtain the fuzzy rules in all cases. Some examples of the designed fuzzy rules are illustrated in Table 2.