Skip to main content
. 2025 Nov 13;25(22):6943. doi: 10.3390/s25226943
Algorithm 1. The pseudocode of JS
Inputs: number of search agents (N), number of iterations (mi), initial value of chaotic map (LV0), problem dimension (d), and lower (LB) and upper (UB) boundaries of search space
Outputs: the best jellyfish (XB) and its fitness (FB)
// Swarm generation
i=1
while (iN)
   Initialize Xi using Equation (1)
   Calculate Fi
   i=i+1
end while
Find XB and FB
ci=1
while (cimi)
  i=1
  while (iN)
      Compute c using Equation (3)
      if (cc0)
        // Ocean current
        Update Xi using Equation (4)
      else
        if (r1c)
        // Passive motion
        Update Xi using Equation (13)
        else
        // Active motion
        Calculate step by Equation (15)
        Update Xi using Equation (14)
        end if
      end if
      Update Fi
      i=i+1
  end for
  Update XB and FB
  ci=ci+1
end while
Return XB and FB