Skip to main content
. 2024 Aug 17;9(8):500. doi: 10.3390/biomimetics9080500
Algorithm 1 Pseudo code of the EMSMA
Begin:
 //Initialization
  Initialize z, N, T, L;
  Initialize the the positions of agent X
 //Main loop
  While (t < T) do
   Calculate the fitness of X and obtain Xbest
   Construct Xleader by Equation (10)
   Calculate the W by Equation (8)
   Update Ci, Xmean by Equations (12) and (13)
   For i = 1: N do
    Update p,a by Equations (4) and (7)
    If rand < z then
     Update positions by Equation (9) //Leader covariance learning strategy
    else
     Update positions by Equations (4) and (5)
    End if
   End For
   Update Xbest by Equations (17) and (18) //Improved non-monopoly search mechanism
   For i = 1: N do
    Update positions by Equation (19) //Random differential restart mechanism
   End for
   t = t + 1
  End While
Return: the best fitness and XbestXbest