## 6 Explanation of the ANFIS Model and the Framework  
The input of the model is based on data extracted from Beijing's Guomao metro station. Two parameters (retention rate index and transfer efficiency index) have been selected as input for predicting the overcrowding risk level in the station, and all relevant risk factors have been considered for the input data [17]. In this research, we do not calculate the indices; however, the most important equations will be presented in the following discussion. To calculate the transfer efficiency in the station, which is an essential index (the station state), we require the transfer time (in seconds) and the transfer distance. In an ideal situation, the passenger flow and movement on the platform are a periodically repeated process associated with the departure and arrival of trains. For evaluation and analysis of the process, it has been suggested that the departure and arrival of trains at the platform is a prompt action that finishes quickly. In practice, assume a train denoted (jn\(-\)1) is departing from platform (i) with some of the targeted passengers on board. The passengers left on the platform are at the minimum density level. Then, passengers will start gathering again until they reach the maximum density level just before the arrival of the next train (jn). This process is repeated, and the density level of passengers will increase or decrease depending on train schedules and boarding see Figure 5.  
It has been suggested that the transfer efficiency index in the station channel location is affected by the amount of equipment in the channel (such as stairs and escalators) [17; 101; 102]. If (_v_) is the walking velocity and (_d_) is the distance between equipment, the transfer efficiency can be calculated by the following equation:  
\[\eta_{T}=\frac{\sum_{k=1}^{n}\frac{d_{k}}{\eta_{k}}}{T_{t0}} \tag{11}\]  
Regarding the second index, the retention rate captures the number of passengers left at the platform waiting for the next train because of limited space on the current train. The density of these passengers reaches a maximum level depending on the size of the platform and the standard used to estimate how many people can stand in one square meter. Passengers on the platform are grouped into three periods, based on the departure and arrival of trains, assuming the process occurs with quick actions, as follows:  
Train departure j\({}^{\text{n-1}}\)  
Train arrival j\({}^{\text{n}}\)  
Train departure j\({}^{\text{n}}\)  
Therefore, this retention rate \(\eta_{\text{R}}\) of the terminal as the indicator to represent the proportion of the stranded passengers can be calculated by the equation below:  
\[\eta_{\text{R}}=\frac{\text{N}_{\text{r\,i}}^{\text{J}}}{\text{N}_{\text{w\, i}}^{\text{J}}} \tag{12}\]  
For the ith platform in jth passenger period, the \(\text{N}_{\text{r\,i}}^{\text{J}}\) are the passengers who wait on the platform and can not get in the current train, so they planned to wait for the next one. The number of stranded passengers is restrained by the total waiting passengers \(\text{N}_{\text{w\,i}}^{\text{J}}\) and boarding passengers \(\text{N}_{\text{b\,i}}^{\text{J}}\). For every  
Figure 5: Three-dimensional diagram of an ideal platform with simple train movement and timelines. specific terminal, the stranded passengers can be calculated by a maximum number of passengers left after boarding by the equation below:  
\[\rm{N_{r\;i}^{J}=\left[max\left\{N_{w\;i}^{J}-N_{b\;i}^{J}\;,0\right\}\right]} \tag{13}\]  
Therefore, the number of waiting passengers can be calculated as follows:  
\[\rm{N_{w\;i}^{J}=N_{r\;i}^{J-1}+N_{i\;i}^{J}+N_{t\;i}^{J}} \tag{14}\]  
where \(\rm{N_{r\;i}^{J-1}}\) is the stranded people in the previous period, \(\rm{N_{i\;i}^{J}}\) is the passengers who check in and \(\rm{N_{t\;i}^{J}}\) is the passenger who will alight to the same line in the station in period \(\rm{J}\).