## 2 Materials and Methods
### Dynamic User Priority  
Figure 1 shows that different users yield different requirements which cannot be decided by channel state information alone. Considering NOMA in VLC networks, the three typical aspects including the special channel state, NOMA interruption probability and different QoS requirements are key features, which jointly influence the quality of services.  
This paper introduces the fuzzy logic (FL) system and balances three types of variables, namely, the instantaneous channel gain of a VLC user, the QoS data rate requirement desired by users and the outage of a NOMA-VLC user in a single cell. It is assumed that the FL system is deployed in the center unit of the optical AP. In Table 1, each type of input is represented by three grades--low, medium and high--except for the complex QoS data rate requirement which has more than three grades. The diagram of the fuzzy logic scheme is indicated in Figure 2.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Input Variables of Three Features** & **Grades** \\ \hline VLC channel gain & (Low, Medium, High) \\ User desired data rate & (Low, Low-Medium, Medium-High, High) \\ NOMA-VLC outage probability & (Low, Medium, High) \\ \hline \hline \end{tabular}
\end{table}
Table 1: The grades of membership fuzzification. The labels NOMA and VLC are non-orthogonal multiple access and visible light communication, respectively.  
(1) Fuzzification  
The fuzzification converts input variables of the fuzzy logic (FL) system into linguistic variables with membership functions (MFs). For each variable, the MF is designed to map the value to its corresponding desirabeness membership. Considering that a triangular membership function is a special case in trapezoidal membership, we use the trapezoidal membership of (12) in our NOMA-VLC FL system to give a fine-grained and diversified degree of characterization. Note that the grades are denoted as \(\mathbf{G}\) and \(G\in\mathbf{G}\) in (13). If any two adjacent variables in \((a_{0}^{(G)},b_{0}^{(G)},c_{0}^{(G)},d_{0}^{(G)})\) are equal, the output of the MFs in the definition field between two identical-value adjacent variables is equal to one.  
\[\begin{split} MF_{(G)}\left(x;a_{0}^{(G)},b_{0}^{(G)},c_{0}^{(G)},d_{0}^{(G)}\right)=\left\{\begin{array}{cl}0,&x\leq a_{0}^{(G)}\\ \frac{x-a_{0}^{(G)}}{b_{0}^{(G)}-a_{0}^{(G)}},&a_{0}^{(G)}\leq x\leq b_{0}^{(G) }\\ 1,&b_{0}^{(G)}\leq x\leq c_{0}^{(G)}\\ \frac{d_{0}^{(G)}-x}{d_{0}^{(G)}-c_{0}^{(G)}},&c_{0}^{(G)}\leq x\leq d_{0}^{(G )}\\ 0,&x\geq d_{0}^{(G)}\end{array}\right.\\ \left.\left[a_{0}^{(G)},b_{0}^{(G)},c_{0}^{(G)},d_{0}^{(G)} \right]_{G\in\mathbf{G}}=\left[\begin{array}{ccc}a_{0}^{(G=Low)}&\ldots&d_{0 }^{(G=Low)}\\ \vdots&\ddots&\vdots\\ a_{0}^{(G=High)}&\ldots&d_{0}^{(G=High)}\end{array}\right]_{|\mathbf{G}|\times 4}.\end{split} \tag{12}\]  
(2) Fuzzy Rule Base  
When the priority of a user is indicated by the MF outputs of each feature, the priority should be dynamically decided by three grades (i.e., high, medium and low, as shown in Table 2. Each rule uses the logic operation (i.e., logic operation _and_) and describes the multi-level membership degree of a user priority. Note that the larger membership degree of priority from the same grade should be selected.  
(3) Defuzzification  
Using the gravity centre method, each degree of user priority can be substituted into (14). The use of MFs in (14) can be designed as similar as in (12), transforming the linguistic degree of prioritisation into the score value. When the priority of a user is indicated in different grades of membership degrees, (14) turns the multiple grades into the final score, corresponding to the power allocation factor.  
Figure 2: Fuzzy logic scheme. The labels NOMA and QoS are non-orthogonal multiple access and quality of service, respectively.  
\[\lambda_{k}=\frac{\int_{0}^{1}MF\left(x\right)xdx}{\int_{0}^{1}f\left(x\right)dx}. \tag{14}\]