## 3 Mission and Reliability Driven Fleet Selective Maintenance Planning Two-Stage Method
### Algorithm Design
#### 3.2.1 An Improved Sparrow Search Algorithm Used for Solving Selective Maintenance Planning
As shown in Figure 2, in which the solid points represent nondominant solutions and the hollow points represent general solutions, crowding can be defined as a normalized estimate of the perimeter of a rectangle composed of vertices with two adjacent solutions on either side of that point. Assuming that the coordinates of the solutions on both sides of the solution set are \(Z_{\text{max}}\) and \(Z_{\text{min}}\), respectively, and in a certain dimension, define the normalized length \(Z_{\text{normal}}\) of the rectangle formed by the \(i\)-th solution in this dimension direction as  
\[Z_{\text{normal}}\,=(z_{i+1}-z_{i-1})/(Z_{\text{max}}-Z_{\text{min}}) \tag{21}\]  
The sum of the normalized lengths of the rectangle in all dimensions is the crowding of the \(i\)-th solution in the solution set. In this way, the update strategy of the external file of the algorithm can be expressed as follows: when the algorithm completes a position update, it compares the nondomination rank of the solution of the external file input with the solution in the file, deletes the dominated solution and then retains the solution with low density in the external file. (4) Location update procedure Step 1: Initialize the population Set the sparrow population size \(n\) and the maximum number of iterations itermax. According to the above coding method, the population is initialized, and the position coordinates of each dimension are randomly assigned to each individual within the constraint range of maintenance level as follows:  
\[X=\left[ \begin{array}{cccc}x_{1,1}&x_{1,2}&\cdots&x_{1,d}\\ x_{2,1}&x_{2,1}&\cdots&x_{2,d}\\ \vdots&\vdots&\vdots&\vdots\\ x_{n,1}&x_{n,2}&\cdots&x_{n,d}\\ \end{array} \right] \tag{22}\]  
where \(X\) is the coordinates matrix of the population, and any individual \(i\) in any dimension \(j\) coordinates \(x_{i,j}\) satisfies \(0<x_{i,j}<f_{ij}^{\max}\). After initialization, the population was sorted by the fast nondominated sorting method. Then, according to Equations (8) and (10), the fitness of each individual in the population in the two objectives of mission capability and maintenance cost is given, respectively. Step 2: Producer location update In the sparrow search algorithm, when the alarm value is less than the safety threshold, the producers will search according to Equation (23):  
\[X_{i,j}^{k+1}=\left\{ \begin{array}{ll}X_{i,j}^{k}\cdot\exp\left(\frac{-i}{ \pi\cdot let_{\max}}\right)&R_{2}<ST\\ X_{i,j}^{k}+Q&R_{2}>ST\\ \end{array} \right. \tag{23}\]  
where \(Q\) is a random variable subject to normal distribution, \(X_{i,j}\) represents the position of the \(i\) sparrow in dimension \(j\) and \(ST\) represents the safety threshold; \(iter_{\max}\) is the maximum number of iterations of the algorithm. Since the power of the exponential function in Equation (23) is always less than 0, this step can be regarded as an operation to gradually converge the discoverer individual to the origin of coordinates. This operation is not conducive to the global search ability of  
Figure 2: Crowding calculation method. the algorithm, so the method of making the coordinates increase in random proportion is adopted instead. At this point, the location update rule for the producer becomes  
\[X_{i,j}^{t+1}=\left\{ \begin{array}{ll}X_{i,j}^{t}\cdot(1+Q/3)&\text{ if }\quad P_{i,j}^{t}\geq ST\\ X_{i,j}^{t}+Q&\text{ if }\quad P_{i,j}^{t}\leq ST\end{array} \right. \tag{24}\]  
where \(P_{i,j}\) represents the early warning value of individual sparrows. Since the maintenance level can only be an integer, and there are upper and lower bound constraints, the producer should be integer-processed after updating the above rules, and the coordinates that exceed the constraints should be reset to the value closest to the value that obeys the constraints. After the location update is completed, the population is redivided by the nondominated sorting method, and the scrounger location update process is started.