Skip to main content
. 2024 Jan 2;9(1):20. doi: 10.3390/biomimetics9010020
Algorithm 3 Pseudo-code of CCWFO
Set parameters: The maximum iteration number T, the problem dimension dim, and the population size N
Initialize population X 
t = 1
For i=1:N
  Evaluate the fitness value of xi
  Find the global min xbest
End For
While (tT)
   IF rand<pl 
     For i=1:N                   /* Laminar flow */
        For j=1:dim
          Generate yi by Equations (1) and (2)          
        End For
     Evaluate the fitness value of yi
     Update xi, Xbest
     End For 
   Else
     For i=1:N                 /* Turbulent flow */
        For j=1:dim
          Generate yi by Equation (3)
        End For
     Evaluate the fitness value of yi
     Update xi, Xbest
     End For
   End IF
   For i=1:N                         /*CC*/
     Perform Horizontal crossover search to update xi
     Perform Vertical crossover search to update xi
     Update Xbest
   End For
   t=t+1;
End While
Return Xbest 
End