## 4 The Proposed Modified Rat Swarm Optimizer (MRSO)  
The proposed Modified Rat Swarm Optimizer (MRSO) aims to enhance the original RSO's performance by balancing exploration and exploitation. This balance is achieved through Function No. (2) in the \"Chasing the Prey\" section, which is static and relies on a single parameter, C. In the MRSO, this function is reformulated as follows:  
\[F_{1}=R-(t-1)\times\left(\frac{R}{Max_{iteration}}\right) \tag{6}\]  
\[F_{2}=1-t\times\left(\frac{1}{Max_{iteration}}\right) \tag{7}\]  
\[F_{3}=2\times rand(0,\;1)-1*rand(0,\;1) \tag{8}\]  
\[A_{Modified}=F_{1}\times F_{2}\times F_{3},\;\text{where}\;t=0,\;1,\;2,\;\ldots,\;Max_{iteration} \tag{9}\]  
Consequentially, function No. (1) is updated as follows:  
\[\overset{\rightarrow}{P}=A_{Modified}\overset{\rightarrow}{P_{i}}(t)+C. \left(\overset{\rightarrow}{P_{r}}(t)-\overset{\rightarrow}{P_{i}}(t)\right) \tag{10}\]  
After initializing the parameters \(A_{Modified}\), C, and \(R\), the results are evaluated using an objective function, with the best solution saved as \(\overset{\rightarrow}{P_{r}}\). The rats' positions are then updated using Equation (5), and parameters \(R\), \(A\), and \(A_{Modified}\) are updated according to Equations (3), (4), and (6)-(9). If a rat's position exceeds the search space, it is adjusted by reassigning it to the previous centers. Each rat's position is then tested and assessed by the objective function. If a better solution than \(\overset{\rightarrow}{P_{r}}\) is found, \(\overset{\rightarrow}{P_{r}}\) is updated to this new best position. This process continues through the maximum number of iterations (\(Max_{iteration}\)). Ultimately, the position is selected using the best position identified \(\overset{\rightarrow}{P_{r}}\). These modifications result in improved performance through obtaining the optimum fitness function. Algorithm 1 and Figure 1 present the MRSO pseudocode and flowchart, respectively.  
Figure 1: A flowchart representation of the MRSO algorithm.  
```
1:Initial the parameters of MRSO: \(N\), \(d\), \(T_{max}\), \(A\), \(C\), and \(R\)
2:Initial of MRSO population
3:\(X_{i,j}=X_{i}^{min}+\left(X_{j}^{max}-X_{j}^{min}\right)\times\cup(0,1)\)\(\forall_{i}=1,2,\ldots\ldots\ldots N\), and \(\forall_{j}=1,2,\ldots\ldots,d\)
4:Calculate \(f(X_{i})\)\(\forall_{i}=1,2,\ldots\ldots\ldots N\)\(\{\) Fitness evaluation\(\}\)
5:Select the rat with the best position \(X^{\textit{best}}\)
6:\(t=1\)
7:while\((t\leq T_{max})\)do
8:\(R\in[1,5]\)
9:\(A=R-t\times\left(\frac{R}{T_{max}}\right)\)
10:\(C\in[0,2]\)
11:for\(i=1:N\)do
12:\(\stackrel{{\rightarrow}}{{X}}=A\cdot\stackrel{{ \rightarrow}}{{X}}_{i}(t)+C\cdot\left(\stackrel{{\rightarrow}}{{X} }^{\textit{best}}-\stackrel{{\rightarrow}}{{X}}_{i}(t)\right)\) {Chasing the prey}
13:\(\stackrel{{\rightarrow}}{{X}}_{i}(t+1)=\left|\stackrel{{ \rightarrow}}{{X}}^{\textit{best}}-\stackrel{{ \rightarrow}}{{X}}\right|\) {_fighting with prey_}
14:if\(f\left(\stackrel{{\rightarrow}}{{X}}_{i}(t+1)\right)<f \left(\stackrel{{\rightarrow}}{{X}}^{\textit{best}}\right)\)Then
15:\(\stackrel{{\rightarrow}}{{X}}^{\textit{best}}=\stackrel{{ \rightarrow}}{{X}}_{i}(t+1)\)
16:endif
17:endfor
18:\(t=t+1\)
19:endwhile
20:Return the best solution \(\stackrel{{\rightarrow}}{{X}}^{\textit{best}}\)
```  
**Algorithm 1** The pseudocode representation of the MRSO algorithm