## 3 Methodology
### Sparrow Search Algorithm
Assuming the number of sparrows in the population is N, the dimension of the optimal solution to be searched is D, the position of each sparrow is \(X=(x_{1},x_{2},\ldots,x_{\text{D}})\), and the fitness is \(f_{i}=f(x_{1},x_{2},\ldots,x_{\text{D}})\), then the initialized population can be represented as  
\[X= \begin{pmatrix}x_{1}^{1}&x_{1}^{2}&\cdots&x_{\text{D}}^{1}\\ x_{2}^{1}&x_{2}^{1}&\cdots&x_{2}^{1}\\ \vdots&\vdots&&\vdots\\ x_{\text{N}}^{1}&x_{\text{N}}^{2}&\cdots&x_{\text{N}}^{1}\\ \end{pmatrix} \]  
The SSA algorithm comprises three components: a discoverer, follower, and alert. Using the mean square error between predicted and true values as the fitness value, the ratio of sparrow discoverers and followers is updated. Then, the iteration updates are carried out according to the position update rules of each functional population, which adjust their locations based on the principles listed below. Discoverer  
Discoverers, as individuals in the population who find better food, are responsible for providing guidance to their followers. Select the top PN sparrows with the best fitness values as the discoverers in each generation; they account for 20%. The formula for updating their position is as follows:  
\[x_{i,j}^{t+1}=\left\{ \begin{array}{ll}X_{i,j}^{t}\times\exp\left(-\frac{ \text{i}}{\alpha\times\text{T}}\right)&\text{if}\ \text{R}_{2}<\text{ST}\\ X_{i,j}^{t}+\text{Q}\times\text{L}&\text{if}\ \text{R}_{2}\ \geq\text{ST}\\ \end{array} \right. \tag{1}\]Of these, x is the position of the ith sparrow in dimension j of the search space at iteration t; i is the sparrow number, t; T is the maximum number of iterations regarding random number \(\alpha\in(0,1]\), warning values R\({}_{2}\in[0,1]\), and ST \(\in[0.5,1]\) for safety values; Q is the random value; and L is a matrix of dimension \(1\times\) d with all elements as 1. When R\({}_{2}<\) ST, there are no predators in the foraging environment, and finders conduct extensive searches in the area; when R\({}_{2}\geq\) ST, scouts detect the presence of predators, and the group moves rapidly toward a safe area. * Follower  
Except for the discoverers, all remaining N-PN individuals serve as followers, accounting for 80%, and their position update formula is as follows:  
\[x_{ij}^{t+1}=\left\{ \begin{array}{ll}Q\times\exp(\frac{x_{\text{users}}^{t}-x _{ij}^{t}}{t^{2}})&\text{if \ \ i>0.5n}\\ x_{\text{p}}^{t+1}+\left|x_{ij}^{t}-X_{\text{p}}^{t+1}\right|\times L\times A +\text{if \ \ i\leq 0.5n}\end{array} \right. \tag{2}\]  
\(x_{ij}^{t+1}\) is the location with optimal adaptation controlled via the discoverer at the t + 1 st iteration, \(X_{\text{worst}}^{t}\) is the global worst location, A\({}^{+}\) is a matrix randomly assigned to 1 or \(-1\) with dimension \(1\times\) d, and A\({}^{+}\) = \((\text{AA}^{T})-1\). When i > 0.5n, the ith accession that fails to acquire food and has a low energy level needs to go to other areas to forage; when i \(\leq 0.5n\), the ith accession will follow the discoverer's foraging center and randomly forage near the center position. * Alert  
Selecting a certain number of alerts to perform reconnaissance and early warning tasks and giving up food when facing danger are involved, assuming each generation randomly selects SD sparrows for reconnaissance and warning. The formula for updating its position is as follows:  
\[x_{ij}^{t+1}=\left\{ \begin{array}{ll}X_{\text{best}}^{t}+\beta\times\left|x _{ij}^{t}-X_{\text{best}}^{t}\right|&\text{if \ \ f_{i}>f_{g}}\\ x_{ij}^{t}+K\times\left(\frac{x_{ij}^{t}-X_{\text{worst}}^{t}}{(f_{i}-f_{w}) \,\varepsilon}\right)&\text{if \ \ f_{i}=f_{g}}\end{array} \right. \tag{3}\]  
\(X_{\text{best}}^{t}\) is the global optimal position; \(\beta\) is a step control parameter, a random number of K \(\in[-1,1]\); f\({}_{i}\) is the fitness value of the ith individual sparrow; \(f_{g}\) and \(f_{w}\) are the best and worst fitness values; and \(\varepsilon\) is a minimal constant.