sustainability

Article Urban Rail Transit Passenger Flow Forecasting Method Based on the Coupling of Artificial Fish Swarm and Improved Particle Swarm Optimization Algorithms

Yuan Yuan 1,2, Chunfu Shao 1,*, Zhichao Cao 3 , Wenxin Chen 1, Anteng Yin 4,5, Hao Yue 1 and Binglei Xie 4 1 Key Laboratory of Transport Industry Big Data Application Technologies for Comprehensive Key Laboratory of Transport, Beijing Jiaotong University, Beijing 100044, ; [email protected] (Y.Y.); [email protected] (W.C.); [email protected] (H.Y.) 2 School of Automotive and Transportation, Polytechnic College, Shenzhen 518055, China 3 School of Transportation and Civil Engineering, Nantong University, Nantong 226019, China; [email protected] 4 School of Architecture, Harbin Institute of Technology, Harbin 150001, China; [email protected] (A.Y.); [email protected] (B.X.) 5 Kunming Urban Planning & Design Institute, Kunming 650041, China * Correspondence: [email protected]

 Received: 12 November 2019; Accepted: 16 December 2019; Published: 19 December 2019 

Abstract: Urban rail transit passenger flow forecasting is an important basis for station design, passenger flow organization, and train operation plan optimization. In this work, we combined the artificial fish swarm and improved particle swarm optimization (AFSA-PSO) algorithms. Taking the station of the as an example, subway passenger flow prediction research was carried out. The AFSA-PSO algorithm successfully preserved the fast convergence and strong traceability of the original algorithm through particle self-adjustment and dynamic weights, and it effectively overcame its shortcomings, such as the tendency to fall into local optimum and lower convergence speed. In addition to accurately predicting normal passenger flow, the algorithm can also effectively identify and predict the large-scale tourist attractions passenger flow as it has strong applicability and robustness. Compared with single PSO or AFSA algorithms, the new algorithm has better prediction effects, such as faster convergence, lower average absolute percentage error, and a higher correlation coefficient with real values.

Keywords: urban traffic; subway passenger flow prediction; AFSA-PSO algorithm; normal passenger flow; large-scale tourist attractions passenger flow

1. Introduction Urban rail transit has the characteristics of large traffic volume, high speed, and high security. It has become the main travel mode of transport for residents of large cities. For urban rail transit networks, considering the difference and complexity of passenger flow distribution in peak and low periods, how to precisely predict the passenger flow of urban rail transit in a real-time manner has been an active study field for our research team [1–4] and public transport operation management departments. Studies have been carried out on passenger flow prediction models and algorithms for urban rail transit, which mainly fall into two categories: mathematical model methods and model-free algorithms. The determined model methods and their corresponding optimization algorithms include the ARIMA time series prediction algorithm [5], the nearest-neighbor nonparametric regression algorithm

Sustainability 2019, 11, 7230; doi:10.3390/su11247230 www.mdpi.com/journal/sustainability Sustainability 2019, 11, 7230 2 of 13 for short-term inbound passenger flow prediction [6], and the nearest-neighbor passenger flow prediction algorithm based on the fuzzy value time series relationship [7]. Yao Enjian et al. put forward a way to determine real-time inbound and outbound passenger flow of new stations at the initial stage of opening based on improved k-near nonparametric regression [8]. There are also prediction methods, Bayesian networks [9], a tracking orthogonal least-squares algorithm [10], and traffic flow prediction based on a Kalman filtering model [11]. Regarding model-free algorithms and their optimization algorithms, such as wavelet support vector machine [12], Feng et al. proposed a short-term inbound passenger flow prediction model of urban rail transit based on the grey wolf optimizer and a wavelet neural network [13]. Huang and Han proposed a short-term bus stop based on improved limit learning machine time based on a passenger flow prediction method and a bionic algorithm based on biological group intelligence [14], such as using a dynamic change energy aware adaptive particle swarm optimization algorithm (DCW-APSO) to optimize an LS-SVM to predict high-speed railway passenger flow using grey support vector machine calibrated by particle swarm optimization (PSO) [15,16]. The above studies provide an important research basis for designing and optimizing algorithms of urban rail transit passenger flow prediction models. Existing algorithms have the following characteristics: (1) Due to the limitations of the models themselves, methods based on mathematical analytical models have difficulties dealing with the impact of random interference factors on subway passenger flow. Thus, they cannot reflect the high uncertainty and nonlinearity of the traffic flow system itself, and the prediction accuracy is not high for intelligent model prediction methods based on knowledge. However, model-free algorithms obtain prediction “experience” and “knowledge” through the structure mechanism of the method itself, so as to predict the traffic in the next period, which has a certain adaptive ability [11]. (2) Due to the high demand for sample data of subway passenger flow and the large amount of algorithm calculations but the low efficiency of mathematical analytical models, it is difficult to adapt to calculations of large-scale data [11]. (3) In recent years, China has constructed an increasing number of large theme parks and hosted large-scale international events. The theme park tourists leave at night and large-scale events cause thousands of people to travel together, which puts an enormous amount of pressure on already tense urban transportation systems, thus necessitating higher requirements for traffic planning, traffic impact analysis, and traffic management [9]. At present, most research mainly focuses on the prediction of subway passenger flow in the normal morning and evening peaks, while there is less research on the prediction of passenger flow before and after the departure of large theme parks or large-scale activities. (4) The bionic algorithm is a general term for a kind of random search method that simulates the evolution of natural organisms or the social behavior of groups. Compared with neural network models, these algorithms do not rely on gradient information when solving, so they are widely used, especially for large-scale complex optimization problems that are difficult to be solved by traditional methods [12]. Current bionic algorithms are usually used to optimize other algorithms [15,16], and their advantages as the main body of a prediction algorithm are less frequently considered. However, the existing methods, such as the particle swarm algorithm, the artificial ant colony algorithm, and the artificial bee colony algorithm have the disadvantage of premature convergence. A feasible solution is difficult to guarantee global optimization [12]. The artificial fish swarm algorithm (AFSA) has a good ability to overcome local extremum and obtain global extremum. Moreover, the algorithm only uses the function value of the objective function and does not need special information such as the gradient value of the objective function, so it has a certain adaptive ability to the search space. The algorithm has no requirement for initial values and is not sensitive to the selection of parameters [17]. AFSA-PSO algorithm‘s advantages compared with the traditional estimation models are as follows: (1) It can adapt to calculations of large-scale data and has high efficiency, which can also reflect Sustainability 2019, 11, 7230 3 of 13 the high uncertainty and nonlinearity of the traffic flow system itself compared with methods based on mathematical analytical models [11]; (2) Compared with neural network models, AFSA-PSO algorithm only uses the function value of the objective function and does not rely on gradient information, so it has a certain adaptive ability to the search space. Moreover, they are widely used, especially for large-scale complex optimization problems [12]; (3) Comparing the traditional machine-learning algorithms such as SVM and SVR, AFSA-PSO algorithm has no requirement for initial values and is not sensitive to the selection of parameters [17]; (4) AFSA-PSO algorithm has a good ability to overcome local extremum and obtain global extremum compared with single PSO algorithm and other bionic algorithms [12,17]. Therefore, in this study, we took the advantages of the PSO bionic algorithm and used the artificial fish swarm algorithm (AFSA) to make up for its deficiencies, resulting in the AFSA-PSO algorithm. The rest of this paper is organized as follows: for the principle of the algorithm, the PSO and AFSA algorithms are separately introduced in Section2. In Section3, the proposed coupling of the AFSA and improved PSO algorithms (AFSA-PSO) is elaborated, which improves the efficiency of the solution by self-regulation of particles and dynamic weight distribution. It also avoids premature convergence of particles and has the characteristics of fast convergence near the optimal solution. In Section4, we describe how the new algorithm was used to predict the normal rail transit passenger flow and the rail transit passenger flow during the period of tourists leaving large-scale attractions, taking into account the average absolute percentage error, iteration speed, and correlation coefficient index between the prediction results and the real values to evaluate the effectiveness of the algorithm. Finally, in Section5, the results are discussed and future research is considered.

2. Algorithm Principle

2.1. PSO Algorithm Generally, the traditional PSO algorithm needs to abstract the potential solution of the objective function into particles with specific speed and motion direction in the dimension space and to search in the solution space [18]. The specific steps are as follows: Step 1: Set the parameters required for algorithm iteration—(1) inertia weight, that is, the coefficient that the particle keeps its original speed; (2) cognition coefficient, that is, the weight coefficient of the historical optimal value of the particle tracking itself; (3) social knowledge coefficient, that is, the weight coefficient of the optimal value of the particle tracking group; (4) random number evenly distributed in the interval; (5) constraint factor; (6) satisfaction error; and (7) maximum number of iterations. Step 2: Initialize the particle swarm. Calculate the initial value of all particles. Step 3: Update. According to formulas (1) and (2), calculate the speed and position of each particle and recalculate the better solution of the particles according to the updated state:

v + = ωv + hξ(p x ) + gη(q x ) (1) k 1 k k − k k − k

xk+1 = xk + γvk+1 (2) where vk is the speed of the particle after k iterations, xk is the position of the particle after k iterations, pk is the historical optimal value searched by the particle, and qk is the optimal value searched by all particles. Step 4: Convergence discrimination. If the current solution is within the range of satisfactory error or reaches the maximum number of iterations, the algorithm ends; otherwise, return to step 3 and repeat.

2.2. AFSA Algorithm The artificial fish swarm algorithm is a kind of bionic algorithm. Fish can swim and search for food quickly and nimbly in the water. It depends on the ability of information sharing between fish Sustainability 2020, 12, x FOR PEER REVIEW 4 of 13

The artificial fish swarm algorithm is a kind of bionic algorithm. Fish can swim and search for Sustainability 2019, 11, 7230 4 of 13 food quickly and nimbly in the water. It depends on the ability of information sharing between fish swarms and information analysis of fish swarms to external stimulation so as to search for food as swarmsmuch as andpossible information and avoid analysis being swallowed of fish swarms [19].to external stimulation so as to search for food as muchThe as possibleAFSA algorithm and avoid optimization being swallowed process [19 is]. based on the artificial fish model design, and the

individualThe AFSA state algorithmof the fish optimizationis Xxxx ()12, , processn is, among based on which the artificialxini ,12 , fish , model is design, the variable and the to individual state of the fish is X = (x , x , xn), among which xY, i= f() X1, 2 , n is the variable to be be optimized; the food concentration1 2 of··· the artificial fish is i ,··· among which Y is the optimized; the food concentration of the artificial fish is Y = f (X), among which Y is the objective d X, X function value; the artificial fish spacing is d = X , X ; and theij artificial fish’s perceived distance is V. objective function value; the artificial fish spacingk i isj k ; and the artificial fish’s perceived Thedistance maximum isV . The step maximum size for artificial step size fish for movementartificial fish is Smovement, and the congestionis S , and the factor congestion is c, as shown factor inis Figurec , as shown1. in Figure 1.

x2

S x1 v xi

xnext

xj x3

Figure 1. ArtificialArtificial fishfish vision

For example, the rear end behavior of a school of fishfish refers to the behavior of a fishfish moving in the optimal direction within its visible area. Artificial fish group x searches for the function optimal the optimal direction within its visible area. Artificial fish group i searches for the function optimal partner xxj among all partners in its field of vision. If xj/nxncx>/ cxi indicates that the surrounding area partner j among all partners in its field of vision. If ji indicates that the surrounding of the optimal partner is not too crowded, then artificial fish group xi moves one step towards the functionarea of the optimal optimal partner partnerxj .is Otherwise, not too crowded, foraging then behavior artificial is performed.fish group moves one step towards The specific steps of the algorithm are as follows [20]: the function optimal partner . Otherwise, foraging behavior is performed. Step 1: Determine the population size f ishnum and randomly generate n individuals xn in the The specific steps of the algorithm are as follows [20]: variable feasible region. The number of iterations is gen. Then, set the visual domain V of artificial fishnum n xn fish.Step The distance1: Determine between the fishpopulation is dij, the size step length isandS, the randomly crowding generate factor is c, andindividuals the number ofin attemptsthe variable is try_number. feasible region. The number of iterations is gen . Then, set the visual domain V of d artificialStep fish 2: Calculate. The distance the individual between fish fitness is valueij , the ofstep each length artificial is S, the fish crowding in the initial factor fish is school c, andand the give the best artificial fishtry_number status and fitness value to the bulletin board. numberStep of 3: attempts Simulate is the behavior of. artificial fish groups, such as foraging, gathering, tailgating, and randomStep behavior. 2: Calculate Generate the individual new fish groupsfitness value by iteration. of each artificial fish in the initial fish school and give Stepthe best 4: Evaluate artificial thefish status status and and fitness fitness of value all individuals. to the bulletin If an board. individual’s status and fitness are betterStep than 3: theSimulate bulletin the board, behavior the of bulletin artificial board fish willgroups be updated., such as foraging, Otherwise, gathering, the bulletin tailgating board, willand remainrandom unchanged. behavior. Generate new fish groups by iteration. Step 4: 5: E Convergencevaluate the status discrimination. and fitness Ifof theall individuals. current solution If an isindividual's within the status range and of satisfactory fitness are errorbetter or than reaches the bulletin the maximum board, the number bulletin of iterations,board will the be algorithmupdated. O ends.therwise, Otherwise, the bulletin return board to step will 2 andremain repeat. unchanged. Step 5: Convergence discrimination. If the current solution is within the range of satisfactory 3.error Algorithm or reaches Design the maximum number of iterations, the algorithm ends. Otherwise, return to step 2 and repeat. In this study, the AFSO-PSO algorithm was designed according to the characteristics of the two algorithms described above, and they are coupled by the dynamic weight. 3. Algorithm Design Scholars in the study of prediction model to confirm the weight of each index. There are different methodsIn this summed study, upthe into AFSO two-PSO categories: algorithm fixed was weight designed method according and dynamic to the weightcharacteristics method. of The the fixed two weightalgorithms method described includes above, questionnaire and they surveyare coupled method by [the21], dynamic analytic hierarchyweight. process [22] and entropy weightScholars method in the [23 ],study etc. of These prediction methods model calculate to confirm the weight the weight in advance, of each index and. the There weight are different is fixed inmethods the prediction summed process. up into However,two categories: the actual fixed situation weight method is very complex.and dynamic It is weight impossible method. for eachThe index to maintain the same weight with the change of index value [24], so there is a dynamic weight Sustainability 2019, 11, 7230 5 of 13 method. By comparing the error between the simulation value and the measured value, the current weight value is adjusted dynamically, and the weight correction table [25] is established. In bionic algorithm, dynamic weight method is often used to balance the global search and local search ability of population [26,27]. Therefore, the new algorithm uses the concept of dynamic weight in the above paper for reference, coupling particle swarm and fish swarm algorithm to find optima mutation population examples. At the beginning of the algorithm iteration, the accuracy of particle optimization direction is required to be higher, so the weight of artificial fish swarm algorithm is larger. At the end of the algorithm iteration, the global optimal solution domain of particles is rapidly reduced, and the convergence of the optimization process is required to be higher, so the weight of particle swarm algorithm is larger. This algorithm successfully retains the advantages of PSO rapidity, convergence and AFSA globality, and traceability through particle self-regulation and dynamic weight. At the same time, it effectively avoids the shortcomings of "premature" in the process of particle optimization, obvious reduction of convergence speed in the later stage, and balances the global and local search capabilities of the population. The specific steps of the algorithm are as follows: Step 1: Initialization. Set the parameters and models of the PSO and AFSA algorithms as shown in Section2. Step 2: Independently carry out the PSO and AFSA algorithms and obtain the new particle swarm, new fish swarm, and initial value after iterative updating. Judge whether the new particles and fish need self-regulation. If so, turn to step 3; if not, turn to step 4. Among them, the judgment basis for new particles and new schools to enter into self-regulation is as follows: The PSO algorithm judges according to the difference between the local optimal value and the global optimal value. If the difference is too small, it means that the particles are too concentrated and need self-regulation. uv tu K m 1 1 X X a = (q p )2 (3) K m j − ij i=1 j=1 where a is the average aggregation degree of particles, K is the particle swarm size, m is the particle dimension, qj is the global optimal value, and pij is the local optimal value. The AFSA algorithm is based on the number of times that the numerical change rate in the bulletin board is less than the specified change rate ρ. If the number of times is too much, it means that the change of optimal fitness is not obvious and self-regulation is needed. Step 3: Adjust the state of the particle and fish swarms: (1) Recalculate the positions of the particles and artificial fish by using update rules Pt+1(i) and At+1(i):

Pt+1(i) = Pt(i) + ru0 Pt(i) (4)

At+1(i) = At(i) + ru0 At(i) (5) where r is the m dimension vector composed of random numbers between [ 1, 1], u is the transposition − 0 of m dimension vector u generated randomly and only composed of 0 and 1, Pt(i) is the Pt(i) arithmetic mean value after taking the absolute number for each dimension value, and At(i) is the At(i) arithmetic mean value after taking the absolute number for each dimension value. (2) According to Pt+1(i) and At+1(i), update the global optimal value qj, the local optimal value pij, and the bulletin board. (3) Judge whether the particle and fish swarms still need self-regulation. If yes, go to step 3 (1); if no, go to step 4. Step 4: Use the mutation rule to generate the mutation population:

B + = α + P + + (1 α + )A + (6) t 1 t 1 t 1 − t 1 t 1 Sustainability 2020, 12, x FOR PEER REVIEW 6 of 13

Pi() Ai() q (2) According to t 1 and t 1 , update the global optimal value j , the local optimal value p ij , and the bulletin board. (3) Judge whether the particle and fish swarms still need self-regulation. If yes, go to step 3 (1); if no, go to step 4. Step 4: Use the mutation rule to generate the mutation population:

BPAttttt11111(1) (6) Sustainability 2019, 11, 7230 6 of 13 B ( 1)t  P ( 1)t  where t 1 is the mutation population particle after searches, t 1 is the particle after A (t  1)  (1  ) wheresearchesBt+1, is thet 1 is mutation the fish population population particle particle after after (t + 1) searches,searches, Pt+t 11 is and the particlet 1 after are ( thet + 1) searches,weight coefficientsAt+1 is the fishof the population PSO and AFSA particle algorithm after (ts,+ respectively.1) searches, αt+1 and (1 αt+1) are the weight − coefficients of the PSO and AFSA algorithms,(1  respectively. ) The weight coefficient t 1 and t 1 are related to the number of iterations. In the early The weight coefficient α + and (1 α + ) are related to the number of iterations. In the early stage stage of algorithm iteration,t the1 search− processt 1 requires higher direction, so the weight of the AFSA ofalgorithm is iteration, larger. I then the search late processstage of requires algorithm higher iteration, direction, the global so the optimal weight ofsolution the AFSA domain algorithm is is larger.rapidly In reduced, the late stageand the of algorithm search process iteration, requires the global higher optimal convergence, solution so domain the weight is rapidly of the reduced, PSO andalgorithm the search is larger. process requires higher convergence, so the weight of the PSO algorithm is larger. 1  1 (1)t αt+1t 1= (t + 1) (7) (7) T × wherewhereT Tis theis the maximum maximum number number of of iterations, iterations, and andt ist is the the current current number number of of iterations. iterations. StepStep 5: 5: Convergence Convergence discrimination.discrimination. If If the the current current solution solution meets meets the the convergence convergence criteria criteria or or reachesreaches the the maximum maximum number number ofof iterations,iterations, the iteration is is ended ended.. O Otherwise,therwise, step step 2 is 2 isrevisited revisited and and thethe iteration iteration is is repeated. repeated. The The procedure procedure ofof thethe algorithm is is shown shown in in detail detail in in Figure Figure 2.2 .

Regulation rule Searching for optimal value of New Artificial Update Artificial Fish Fish Swarm rule Recalculate the Yes Swarm position of UpdateYes global best, local Self- Start Change state? particles and best, bulletin board Searching for regulation New Particle artificial fish optimal value of Swarm Particle Swarm No Dynamic weight

Sort and Select the first Variant N population

Iterative Yes End iteration? End population

No

FigureFigure 2.2. AFSA-PSOAFSA-PSO algorithm algorithm flow flowchart.chart.

4.4. Case Case Study Study 4.1. Normal Passenger Flow Forecast 4.1. Normal Passenger Flow Forecast NormalNormal passenger passenger flow flow forecasting forecasting waswas performed in in three three steps: steps: (1) (1) Passenger Passenger flow flow data data of four of four workingworking days days were were used used as as the the training training set,set, the algorithm was was trained, trained, and and the the passenger passenger flow flow of the of the fifthfifth working working day day was was predicted, predicted, soso thatthat thethe algorithm could could reach reach a astable stable forecast forecast state state.. (2)(2) The The passengerpassenger flow flow data data of of four four working working days days were were selected selected as as the the testtest setset again,again, andand the passenger flow flow of theof fifth the workingfifth working day wasday predicted.was predicted In order. In order to eff toectively effectively control control the influencethe influence of system of system error error on the predictionon the prediction results, the results, arithmetic the arithmetic mean value mean of value the first of the 10 first prediction 10 prediction results results was selected was selected as the as final result.the final (3) The result passenger. (3) The flow passenger of 10 di flowfferent of 10 working different days working was predicted days was to predicted verify the to robustness verify the of therobustness algorithm, of and the thealgori algorithmthm, and was the verifiedalgorithm by was comparing verified andby comparing analyzing theand meananalyzing average the absolutemean percentage error (MAPE), iteration speed, correlation coefficient, and other indicators of accuracy for the prediction results. Considering the greater fluctuation and mobility of the passenger flow in the peak hours of working days, which is not conducive to the management and control of rail stations, we carried out normal passenger flow prediction for the early peak (7:00–9:00 a.m.) and the late peak (5:00–7:00 p.m.) for the Window of the World station. The prediction results showed the following: (1) The trend of the normal passenger flow prediction curve of the three algorithms was basically consistent with the real value curve, and the coincidence degree was relatively high. Among them, the predicted value curve of AFSA-PSO was the closest to the real value curve, as shown in Figures3 and4. SustainabilitySustainability 20202020,, 1212,, xx FORFOR PEERPEER REVIEWREVIEW 77 ofof 1313 average absolute percentage error (MAPE), iteration speed, correlation coefficient,, and other indicatorsindicators ofof accuracyaccuracy forfor thethe predictionprediction results.results. Considering thethe greater greater fluctuation fluctuation an and mobility of the passenger flow in the peak hours of working days, which is not conducive to the management and control of rail stations, we carrcarriedied out normal passenger flow prediction for the early peak (7:00–9:00 a.m.)) andand thethe latelate peakpeak ((5:00:00–7:00:00 p.m.)) forfor thethe Window of the World station.station. TheThe predictionprediction resultsresults showshoweded thethe followingfollowing:: (1)(1) The trend of the normal passenger flow prediction curve of the three algorithms was basically consistentconsistent withwith thethe realreal valuevalue curve,curve, andand thethe coincidencecoincidence degreedegree was relativelyrelatively high.high. AmongAmong them,them, thethe predictedpredicted valuevalue curvecurve ofof AFSAAFSA--PSO was thethe closestclosest toto thethe realreal valuevalue curve,curve, asas shownshown inin Figures 3 and 4.. (2)(2) The MAPE and iteration speed of the three algorithms were compared. (a)(a) Afterfter thethe PSOPSO algorithm iterated forfor aboutabout 25 times, the particles gradually lostlost diversity, and the MAPE tendeded toto be stable.. (b)(b) TheThe convergenceconvergence speedspeed ofof AFSAAFSA algorithmalgorithm was fasterfaster inin thethe earlyearly stagestage andand slowsloweded downSustainability obviously2019, 11 in, 7230 the later stage.. Afterfter iteratingiterating forfor aboutabout fivefive times,times, thethe MAPEMAPE tendtendeed toto bebe stablestable7 of 13 and was thethe highest highest among among the the three three algorithms algorithms.. (c)(c) The The AFSA AFSA--PSO algorithm had thethe fastest fastest convergenceconvergence speedspeed andand thethe highesthighest operationoperation efficiencyefficiency.. AfterAfter iteratingiterating forfor aboutabout 4545 times,times, thethe MAPE (2) The MAPE and iteration speed of the three algorithms were compared. (a) After the PSO tendtendeded toto bebe stablestable andand thethe lowestlowest ofof thethe threethree aalgorithms,lgorithms, asas shownshown inin Figures 5 and 6.. algorithm iterated for about 25 times, the particles gradually lost diversity, and the MAPE tended to be The MAPEss of 10 working day forecast data were comparedcompared.. (a)(a) Among 10 groups of forecast stable. (b) The convergence speed of AFSA algorithm was faster in the early stage and slowed down data, the MAPE of AFSA--PSO was thethe smallest smallest and and the the forecast forecast accuracy accuracy was thethe highest highest.. (b)(b) obviously in the later stage. After iterating for about five times, the MAPE tended to be stable and was Compared with PSO and AFSA, the average MAPE of early peak decreased by 0.77% and 1.21%,, the highest among the three algorithms. (c) The AFSA-PSO algorithm had the fastest convergence respectively,respectively, andand thethe averageaverage MAPEMAPE ofof thethe latelate peakpeak decreaseddecreased byby 2.78%2.78% andand 2.90%2.90%,, respectively,respectively, speed and the highest operation efficiency. After iterating for about 45 times, the MAPE tended to be with a relatively obvious decrease, and the forecast accuracy of thethe earlyearly peakpeak was higher, as shown stable and the lowest of the three algorithms, as shown in Figures5 and6. inin Tabless 1 and 2.

Figure 3. TheThe morning morning peak peak passenger passenger flow flow prediction prediction...

Sustainability 2020, 12, x FOR PEERFigure REVIEW 4. TheThe evening evening peak peak passenger passenger flow flow prediction prediction... 8 of 13

Figure 5. The morning peak mean absolute deviation deviation..

Figure 6. The evening peak mean absolute deviation.

Table 1. The morning peak mean absolute deviation statistics.

Group AFSA-PSO PSO AFSA 1 4.02% 4.88% 5.17% 2 2.41% 3.89% 4.14% 3 3.17% 3.47% 4.11% 4 2.89% 4.08% 4.29% 5 3.37% 3.63% 4.69% 6 3.15% 3.42% 4.17% 7 3.69% 4.25% 4.57% 8 3.01% 4.87% 4.00% 9 4.54% 4.81% 5.59% 10 3.30% 4.01% 4.98% Average 3.36% 4.13% 4.57%

Table 2. The evening peak mean absolute deviation statistics.

Group AFSA-PSO PSO AFSA 1 3.83% 6.36% 5.88% 2 4.59% 5.82% 6.61% 3 4.34% 6.48% 6.63% 4 3.93% 6.70% 7.10% 5 4.23% 8.38% 8.18% 6 4.65% 8.28% 8.86% 7 4.79% 8.32% 8.79% 8 4.89% 7.22% 7.59% 9 3.65% 5.59% 5.93% Sustainability 2020, 12, x FOR PEER REVIEW 8 of 13

Sustainability 2019, 11, 7230 8 of 13 Figure 5. The morning peak mean absolute deviation.

Figure 6. The evening peak mean absolute deviation deviation..

The MAPEs of 10 workingTable 1. The day morning forecast peak data mean were absolute compared. deviation (a) Among statistics 10. groups of forecast data, the MAPE of AFSA-PSO was the smallest and the forecast accuracy was the highest. (b) Compared Group AFSA-PSO PSO AFSA with PSO and AFSA, the average MAPE of early peak decreased by 0.77% and 1.21%, respectively, 1 4.02% 4.88% 5.17% and the average MAPE of the late peak decreased by 2.78% and 2.90%, respectively, with a relatively 2 2.41% 3.89% 4.14% obvious decrease, and the forecast accuracy of the early peak was higher, as shown in Tables1 and2. 3 3.17% 3.47% 4.11% Table4 1. The morning2.89% peak mean absolute4.08% deviation statistics.4.29% 5 3.37% 3.63% 4.69% 6 Group3.15% AFSA-PSO 3.42% PSO AFSA 4.17% 7 13.69% 4.02%4.25% 4.88% 5.17% 4.57% 8 23.01% 2.41%4.87% 3.89% 4.14% 4.00% 9 34.54% 3.17%4.81% 3.47% 4.11% 5.59% 4 2.89% 4.08% 4.29% 10 3.30% 4.01% 4.98% 5 3.37% 3.63% 4.69% Average 63.36% 3.15%4.13% 3.42% 4.17% 4.57% 7 3.69% 4.25% 4.57% Table 2. The8 evening peak 3.01% mean absolute 4.87% deviation 4.00% statistics. 9 4.54% 4.81% 5.59% Group AFSA10-PSO 3.30% 4.01%PSO 4.98% AFSA 1 Average3.83% 3.36%6.36% 4.13% 4.57% 5.88% 2 4.59% 5.82% 6.61% 3 Table 2. The evening4.34% peak mean absolute6.48% deviation statistics.6.63% 4 3.93% 6.70% 7.10% Group AFSA-PSO PSO AFSA 5 4.23% 8.38% 8.18% 6 14.65% 3.83%8.28% 6.36% 5.88% 8.86% 2 4.59% 5.82% 6.61% 7 34.79% 4.34%8.32% 6.48% 6.63% 8.79% 8 44.89% 3.93%7.22% 6.70% 7.10% 7.59% 9 53.65% 4.23%5.59% 8.38% 8.18% 5.93% 6 4.65% 8.28% 8.86% 7 4.79% 8.32% 8.79% 8 4.89% 7.22% 7.59% 9 3.65% 5.59% 5.93% 10 4.66% 8.24% 7.02% Average 4.36% 7.14% 7.26%

The MAPE was calculated as follows:

n P x L ( | i− i| 100%) Li i=1 ∗ δ = (8) n Sustainability 2019, 11, 7230 9 of 13

where δ is the average absolute percentage error, xi and Li are the predicted value and the real value of the ith group data, respectively, and n are the number of prediction groups. (4) The correlation coefficients p between the predicted value and the real value of the three algorithms were compared. (a) The Pearson correlation coefficients of the three algorithms were all high, the significance level p was approximately 0, and there was a strong linear relationship between the predicted value and the real value. (b) Among the 10 groups of data, the average value of the Pearson correlation coefficient of AFSA-PSO was the highest, reaching 0.998 and 0.990 at morning and evening peaks, respectively, which was significantly better than PSO and AFSA. The detailed comparison is presented in Tables3 and4.

Table 3. The morning peak normal passenger flow prediction accuracy evaluation index.

Pearson Correlation Coefficient Group AFSA-PSO PSO AFSA 1 0.998 0.998 0.985 2 0.999 0.996 0.984 3 0.998 0.980 0.998 4 0.998 0.964 0.998 5 0.998 0.946 0.997 6 0.997 0.963 0.997 7 0.996 0.986 0.995 8 0.998 0.748 0.997 9 0.998 0.952 0.997 10 0.997 0.996 0.984 Average 0.998 0.953 0.993

Table 4. The evening peak normal passenger flow prediction accuracy evaluation index.

Pearson Correlation Coefficient Group AFSA-PSO PSO AFSA 1 0.994 0.987 0.957 2 0.989 0.980 0.946 3 0.997 0.974 0.964 4 0.998 0.985 0.973 5 0.982 0.974 0.943 6 0.993 0.981 0.970 7 0.983 0.977 0.881 8 0.987 0.980 0.947 9 0.994 0.984 0.965 10 0.987 0.976 0.934 Average 0.990 0.980 0.948

In conclusion, compared with the PSO and AFSA algorithms, the AFSA-PSO algorithm had the highest prediction accuracy and the best effect. The prediction effect of the early peak was better than that of the late peak.

4.2. Prediction of Large-Scale Tourist Attraction Passenger Flow Traffic demand prediction is an important part of traffic organization and management of large-scale tourist spots. It provides a decision-making basis for the safe and fast evacuation of tourist spots by predicting the passenger flow of the transport network of large-scale tourist spots in a certain period and carrying out traffic distribution [28]. The passenger flow forecast of large-scale tourist attractions is consistent with that of normal passenger flow. As the opening time of the Window of the World night market is 7:30 p.m., the tourists Sustainability 2020, 12, x FOR PEER REVIEW 10 of 13 Sustainability 2020, 12, x FOR PEER REVIEW 10 of 13

4.2. Prediction of Large-scale Tourist Attraction Passenger Flow 4.2. Prediction of Large-scale Tourist Attraction Passenger Flow Traffic demand prediction is an important part of traffic organization and management of large- Traffic demand prediction is an important part of traffic organization and management of large- scale tourist spots. It provides a decision-making basis for the safe and fast evacuation of tourist spots scale tourist spots. It provides a decision-making basis for the safe and fast evacuation of tourist spots by predicting the passenger flow of the transport network of large-scale tourist spots in a certain by predicting the passenger flow of the transport network of large-scale tourist spots in a certain period and carrying out traffic distribution [28]. Sustainabilityperiod and2019 carrying, 11, 7230 out traffic distribution [28]. 10 of 13 The passenger flow forecast of large-scale tourist attractions is consistent with that of normal The passenger flow forecast of large-scale tourist attractions is consistent with that of normal passenger flow. As the opening time of the Window of the World night market is 7:30 p.m., the passenger flow. As the opening time of the Window of the World night market is 7:30 p.m., the touristsof the day of marketthe day leave market before leave 7:00 before p.m. 7 on:00 holidays. p.m. on holidays. The railway The station railway shows station obvious show passengers obvious tourists of the day market leave before 7:00 p.m. on holidays. The railway station shows obvious passengerflow fluctuations flow fluctuation from 5:00s to from 7:00 5 p.m.:00 to as 7:00 shown p.m.in as Figure shown7 .in Figure 7. passenger flow fluctuations from 5:00 to 7:00 p.m. as shown in Figure 7.

Figure 7. Passenger flow forecast of large tourist spots. Figure 7. Passenger flow flow forecast of large tourist spots.spots.

Therefore, for the Window of the World on holidays from 5:00 to 7:00 p.m., after carrying out Therefore, for the W Windowindow of the WorldWorld onon holidaysholidays from 5:005:00 to 7:007:00 p.m.,p.m., after carryingcarrying out passenger flow prediction of large-scale tourist spots, the prediction results showed the following: passenger flowflow prediction of large-scalelarge-scale touristtourist spots,spots, thethe predictionprediction resultsresults showedshowed thethe following:following: (1) The trend of the predicted value curve of the three algorithms was basically the same as the (1) The trend of the predicted value curve of the three algorithmsalgorithms was basically the same as the real value curve. The algorithm could effectively identify and predict the passenger flow when a large real value curve. The The algorithm algorithm could could effectively effectively identify and predict the passenger flow flow when a large number of tourists left the large-scale tourist attractions. Among them, the predicted value curve of number of tourists left the large-scalelarge-scale tourist attractions. Among them, the predicted value curve of AFSA-PSO was the closest to the real value curve, as shown in Figure 8. AFSA-PSOAFSA-PSO was the closest to the real valuevalue curve,curve, asas shownshown inin FigureFigure8 8. .

Figure 8. Leaving passenger flow prediction. Figure 8. Leaving passenger flow flow prediction prediction.. (2) The MAPEs and iteration speeds of the three prediction algorithms were compared. (a) After (2) T Thehe MAPE MAPEss and iteration speed speedss of the three prediction algorithms were compared. (a) A Afterfter about 10 iterations of the PSO algorithm, the particles gradually lost diversity, and the MAPE tended about 10 iterations of the PSO algorithm, the particles gradually lost diversity, and the MAPE tend tendeded to be stable and was the highest among the three algorithms. (b) The convergence speed of the AFSA to be stable and was the highest among the three algorithms algorithms.. (b) (b) T Thehe convergence speed of the AFSA algorithm was faster in the early stages of iteration, and the speed was significantly reduced after algorithm was faster in the early stages of iteration, and the speed was significantlysignificantly reduced after about five iterations. (c) The convergence speed and operation efficiency of the AFSA-PSO algorithm about five five iterations.iterations. (c) T Thehe convergence speed and operation efficiency efficiency of the AFSA AFSA-PSO-PSO algorithm were the best, and the MAPE tended to be higher after about 20 iterations. It was stable and was the were the best, and the MAPE tendedtended to be higher after about 20 iterations. It was stable and was the lowest of the three algorithms, as shown in Figure 9 and Table 5. lowest of the three algorithms, as shown in Figure9 9 and and Table Tabl5e .5. The correlation coefficient between the predicted value and the real value of the three algorithms was compared. There was a strong linear relationship between the predicted value and the real value of AFSA-PSO, PSO, and AFSA, among which the correlation coefficient of AFSA-PSO was the largest and the linear relationship was the strongest, as shown in Table6. Sustainability 2019, 11, 7230 11 of 13 Sustainability 2020, 12, x FOR PEER REVIEW 11 of 13

Figure 9. LeavingLeaving passenger passenger flow flow prediction prediction of MAPE MAPE..

Table 5. Mean absolute deviation statistics statistics..

AFSA-PSOAFSA-PSO PSO PSO AFSAAFSA 4.47% 4.47%6.87% 6.87% 6.56% 6.56%

TTablehe correlation 6. Prediction coefficient accuracy between evaluation the predicted index ofvalue departure and the passengerreal value flowof the of three large-scale algorithms was compared.tourist attractions. There was a strong linear relationship between the predicted value and the real value of AFSA-PSO, PSO, and AFSA, among which the correlation coefficient of AFSA-PSO was the largest Correlation Coefficient AFSA-PSO PSO AFSA and the linear relationship was the strongest, as shown in Table 6. Pearson 0.896 0.853 0.768 Table 6. Prediction accuracySignificance evaluation level index of departure0.000 passenger 0.000 0.000 flow of large-scale tourist attractions.

5. Conclusions Correlation AFSA-PSO PSO AFSA Based on thecoefficient historical passenger flow data of the Window of the World station of the Shenzhen Metro Line 1, we usedPearson the PSO, AFSA, and0.896 AFSA-PSO algorithms0.853 to predict the0.768 normal and large-scale Significance tourist attraction subway passenger flow.0.000 The results revealed0.000 the following:0.000 (1) In view of thelevel shortcomings of the basic particle swarm optimization (PSO) algorithm in solving function optimization problems, such as easy to fall into "precocity" and obvious reduction 5.of Conclusion convergence speed in the later stage, this paper proposes an improved method: by introducing fish swarmBased on algorithm the historical and dynamic passenger weight flow data to improve of the W theindow mutation of the population.World station In of the the early Shenzhen stages Metroof the algorithmLine 1, we iteration, used the thePSO, optimization AFSA, and processAFSA-PSO requires algorithm highers direction,to predict sothe the normal weight and of large AFSA- scalealgorithm tourist is attraction larger. In subway the late passenger stages of flow. the algorithm The results iteration, revealed the the global following optimization: solution domain(1) In is rapidlyview of reduced, the shortcomings and the convergence of the basic of particle the solution swarm ishigher optimization in the optimization (PSO) algorithm process, in solvingso the weight function of optimization PSO is larger. problems, It is found such that as the easy improved to fall into algorithm "precocity" can and effectively obvious balance reduction the ofrelationship convergence between speed localin the search later stage, ability this and pa globalper proposes search ability an improved by controlling method: the by exploration introducing ability fish swarmand development algorithm and ability dynamic of the weight population to improve with dynamic the mutation weight. population. The simulation In the early results stages show of that the algorithmAFSA-PSO iteration, algorithm the can optimization significantly processreduce the requires number higher of iterations direction, and so running the weight time compared of AFSA algorithmwith the basic is larger particle. In swarm the late optimization stages of the algorithm. algorithm iteration, the global optimization solution domain(2) Theis rapidly current reduced, basic bionic and the algorithm convergence is usually of the used solution to optimize is higher other in the algorithms optimization [15,16 process,], while sothe the advantages weight of of PSO being is larger. the main It is body found of predictionthat the improved algorithm algorithm are rarely can considered. effectively This balance research the relationshipimproves the between theory of local bionic search algorithm, ability takes and the global optimized search bionic ability algorithm by controlling AFSA-PSO the exploration as the main abilitybody of and the development prediction algorithm, ability of andthe population achieves good with results. dynamic weight. The simulation results show that (3)AFSA Most-PSO of thealgorit existinghm literature can significantly focuses on reduce the prediction the number of the of regular iterations passenger and running flow demand time comparedof the general with subwaythe basic station, particle whileswarm the optimization research on algorithm the prediction. of the passenger flow of the subway(2) The station current near basic the large-scalebionic algorithm tourist is attractionsusually used is veryto optimize limited, other especially algorithms when [15 the,16], tourists while theleave. advantages AFSA-PSO of being algorithm the main can e ffbodyectively of prediction predict the algorithm subway passengerare rarely considered. flow of large-scale This research tourist improvesspots in a the certain theory period, of bionic with algorithm strong robustness,, takes the high optimized correlation bionic coe algorithmfficient and AFSA small-PSO error as the between main body of the prediction algorithm, and achieves good results. Sustainability 2019, 11, 7230 12 of 13

the prediction results and the real value. This provides decision-making basis for traffic safety control and safe and rapid evacuation of large-scale tourist spots. (4) AFSA-PSO algorithm has been successfully applied to urban rail transit passenger flow prediction and early warning, which can provide decision support for listing operation scheduling and orderly organization of station passenger flow. To some extent, it has practical guiding significance for improving operation management level and improving emergency decision-making ability. In the future, we will continue to forecast the passenger flow of all lines of the station together with other lines, so as to facilitate the passenger flow management and evacuation of all lines of the station. Based on this algorithm, the principle of entropy will be added to the dynamic weight to further improve the accuracy.

Author Contributions: Writing—original draft preparation, Y.Y.; information providing, Y.Y., C.S., and Z.C.; data discussion, Y.Y., C.S., and Z.C.; writing—review, Y.Y., C.S., and Z.C.; writing—editing, Y.Y., W.C., H.Y., B.X. and A.Y. All authors have read and agreed to the published version of the manuscript. Funding: This research was funded by the Key Project of Basic Scientific Research Expenditure in the Central Universities, grant number 2017JBZ106; the National Natural Science Foundation Youth Fund, grant number Y820631001; the Basic Research Project of Shenzhen Science and Technology Creation Commission, grant number JCYJ20180305163701198; the Humanities and Social Sciences Youth Foundation of the Ministry of Education of China, grant number 19YJCZH002 and the Public Opinion Big Data Key Research Base Project 2019: “–Hong Kong–Macau Greater Bay Area Traffic Public Opinion Network Communication Structure and Its Formation Mechanism under the Background of Emergencies”, grant number YQ2019-01. Conflicts of Interest: The authors declare no conflict of interest.

References

1. Cao, Z.; Ceder, A.; Li, D.; Zhang, S. Optimal synchronization and coordination of actual passenger-rail timetables. J. Intell. Transp. Syst. 2019, 23, 231–249. [CrossRef] 2. Cao, Z.; Ceder, A.; Zhang, S. Real-Time Schedule Adjustments for Autonomous Public Transport Vehicles. Transp. Res. Part C Emerg. Technol. 2019, 109, 60–78. [CrossRef] 3. Cao, Z.; Ceder, A. Autonomous Shuttle Bus Service Timetabling and Vehicle Scheduling Using Skip-Stop Tactic. Transp. Res. Part C Emerg. Technol. 2019, 102, 370–395. [CrossRef] 4. Cao, Z.; Ceder, A.; Li, D.; Zhang, S. Robust and Optimized Urban Rail Timetabling Using a Marshaling Plan and Skip-Stop Operation. Transp. A Transp. Sci. 2020, in press. 5. Li, B. Urban Rail Transit Normal and Abnormal Short-term Passenger Flow Forecasting Method. J. Transp. Syst. Eng. Inf. Technol. 2017, 17, 127–135. 6. Han, G.; Jiao, P. Research of State Vector in Short-Term Passengers Flow Forecasting Based on Nonparametric Regression. J. Syst. Simul. 2017, 29, 2128–2139. 7. Dou, F.; Jia, L.; Qin, Y.; Xu, J.; Wang, L. Fuzzy k-nearest neighbor passenger flow forecasting model of passenger dedicated line. J. Cent. South Univ. (Sci. Technol.) 2014, 45, 4422–4430. 8. Yao, E.; Zhou, W.; Zhang, Y. Prediction of real-time passenger flow in and out of new urban rail transit stations at the initial stage of opening. China Railw. Sci. 2018, 2, 119–127. 9. Yuan, J.; Wang, P.; Wang, Y.; Yang, X. A passenger volume prediction method based on temporal and spatial characteristics for urban rail transit. J. Beijing Jiaotong Univ. 2017, 41, 42–48. 10. Li, Y.; Wang, X.; Sun, S.; Ma, X.; Lu, G. Forecasting short-term subway passenger flow under special events scenarios using multiscale radial basis function networks. Transp. Res. Part C Emerg. Technol. 2017, 77, 306–328. [CrossRef] 11. Dong, C.; Shao, C.; Zhou, X.; Meng, M.; Zhuge, C. Kalman filter algorithm for short-term jam traffic prediction based on traffic parameter correlation. J. Southeast Univ. (Nat. Sci. Ed.) 2014, 44, 413–419. 12. Sun, Y.; Leng, B.; Guan, W. A novel wavelet-SVM short-time passenger flow prediction in Beijing subway system. Neurocomputing 2015, 166, 109–121. [CrossRef] 13. Feng, C.; Yang, J.; Zhou, L.; Zhang, H. Short-term Passenger Flow Forecast for Urban Rail Transit based on GWO-WNN Model. Railw. Transp. Econ. 2019, 41, 98–102. 14. Huang, Y.; Han, L. Short-term Passenger Flow Prediction Method on Bus Stop Based on Improved Extreme Learning Machine. J. Transp. Syst. Eng. Inf. Technol. 2019, 19, 115–123. Sustainability 2019, 11, 7230 13 of 13

15. Zhou, J.; Zhang, D. Direct Ridership Forecast Model of Urban Rail Transit Stations Based on Spatial Weighted LS-SVM. J. China Railw. Soc. 2014, 36, 1–7. 16. Jiang, X.; Zhang, L.; Chen, X. Short-term forecasting of high-speed rail demand: A hybrid approach combining ensemble empirical mode decomposition and gray support vector machine with real-world applications in china. Transp. Res. Part C Emerg. Technol. 2014, 44, 110–127. [CrossRef] 17. Li, X.; Qian, J. Research on artificial fish swarm optimization algorithm based on decomposition and coordination. J. Circuits Syst. 2003, 8, 1–6. 18. Zhao, Y.; Wang, T.; Qin, W.; Zhang, X. Improved Rao-Blackwellised particle filter based on randomly weighted particle swarm optimization. Comput. Electr. Eng. 2018, 71, 477–484. [CrossRef] 19. Yu, S. Case Analysis and Application of MATLAB Optimization Algorithm; Tsinghua University Press: Beijing, China, 2015. 20. Zhu, X.; Ni, Z.; Ni, L.; Jin, F.; Cheng, M.; Li, J. Improved discrete artificial fish swarm algorithm combined with margin distance minimization for ensemble pruning. Comput. Ind. Eng. 2019, 128, 32–46. [CrossRef] 21. Liu, G.S.; Qi, C.M.; Nie, C.L.; Hu, J. Slope stability e-valuation by the improved AHP and extension theory. Appl, Mech. Mater. 2013, 405, 106–110. 22. Cai, W. Extension engineering and applications. Int. J. Oper. Quant. Manag. 1999, 5, 59–72. 23. Sun, Y. Study on the Safety Early Warning Model of Petrochemical Terminal Tank Farm Based on Extension Theory. Master’s Thesis, Tianjin University of Technology, Tianjin, China, 2015. 24. Wu, J.; LV, P.; Jiang, P.P. Early warning model of Gangue Mountain Landslide Disaster Based on Dynamic Weight. J. Zhongbei Univ. (Nat. Sci. Ed.) 2019, 40, 549–553. 25. LV, F.; Cai, C.; Ding, J.Z.; Yuan, H.X.; Shen, H.P.; Hu, J.F.; Sun, G.Q. Traveling wave location method of single-phase ground fault in tree type distribution network based on dynamic adjustment of weight. Appl. Sci. Technol. 2019, 11, 1–6. 26. Zhou, H.; Yu, L. Cuckoo search algorithm with dynamic inertia weight. CAAI Trans. Intell. Syst. 2015, 10, 645–651. 27. Gao, H.; Wang, L. Bird swarm algorithm based on dynamic inertia weight. Comput. Appl. Res. 2019, 36, 1376–1384. 28. Zhao, H.; Hao, L.; Li, Z. Study on Forecasting of Urban Traffic Demand during Large-scale Events. Logist. Technol. 2014, 10, 305–307.

© 2019 by the authors. Licensee MDPI, Basel, . This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).