## 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
Step 3: Scrounger location update  
In the scrounger location updating stage of the sparrow search algorithm, individuals with better fitness will jump near the producer, which reduces the global search ability of the algorithm. Since the problem model under consideration is discrete, this chapter combines the characteristics of genetic algorithm and adopts the mechanism of elitist to strengthen the local search ability of the algorithm. In this case, the position update rule in the accession stage can be described as the dynamic update process shown in Figure 3.  
Figure 3: Location update rule of MSSA user phase. The sparrow populations are divided into elitist populations composed of first and second nondominant individuals and common populations composed of residual individuals. The elitist population is retained in the process of location update, and the individuals of the common population randomly acquire the genes of the elitist population in some dimensions to replace their own genes. After that, the progeny population is outputted, the population is redistuded by the fast nondominated sorting method, the external file is updated and the alert location is updated. Step 4: Watcher location update  
A watcher is a proportion of individuals randomly selected from the population. Similar to the scrounger position update stage, the watcher adopts the location update method based on genetic algorithm. The sparrow in a better position will move to the individual in a worse position in the population, while the sparrow in a worse position will move to the less crowded position in the external file. The position update rule of the watcher becomes  
\[X_{i,j}^{t+1}=\left\{ \begin{array}{ll}X_{i,j}^{t}+\text{randi}\Big{(}X_{ \text{normal}}\,-\,X_{i,j}^{t}\Big{)}&\text{ if }\quad i\in\text{rank}\,1\\ X_{i,j}^{t}+\text{randi}\Big{(}X_{EA}-X_{i,j}^{t}\Big{)}&\text{ if }\quad i\
otin\text{rank}\,1\end{array} \right. \tag{25}\]  
where \(X_{\text{normal}}\) represents the location of a common population individual, \(X_{EA}\) represents a location recorded in an external file and \(\text{randi}(x)\) represents a random integer between \([0,X]\). The population is then redivided by using the nondominated sorting method, the external file is updated and the second step is returned until the predetermined number of iterations is reached. The overall processes of the proposed multiobjective sparrow search algorithm is summarized into Algorithm 1. ```
1:N: population of sparrows
2:term: maximum iterations
3:Output:
4: nondominated solution set
5:Initialize a population of N sparrows and define its relevant parameters
6:while iter < iterm do
7: rank the population with nondominated sorting approach;
8:for condition do
9: Using Equation (24) update the producers' location;
10: set producers' location as integer
11: Sort the population with nondominated sorting approach;
12: Genetic recombination between elitist swarms and basic swarms;
13: Sort the population with nondominated sorting approach;
14: Save the nondominated solution to the external archive;
15: Using Equation (25) update the guards' location;
16: Sort the population with nondominated sorting approach;
17: Save the nondominated solution to the external archive;
18: iter = iter + 1;
19: Sort the external archive with crowding distance;
20:return nondominated solution set. ```  
**Algorithm 1** The framework of MSSA