Skip to main content
. 2024 Jun 14;9(6):361. doi: 10.3390/biomimetics9060361
Algorithm 1 Crayfish Optimization Algorithm (COA)
Initialization: Iterations T, Population Np, Dimension Dim; Randomly generate an initial population and assess the fitness values to obtain XGbest and XLbest
While (t < T) do
  Defining temperature temp by Equation (2)
  If temp > 30
    Define a cave Xcave based on Equation (4)
    If rand < 0.5
     Update the crayfish position according to Equation (5)
    Else
     Update the crayfish position according to Equation (6)
   End
  Else
   Calculate food intake prop and food size Q are obtained by Equations (3) and (7)
   If Q > (C3 + 1)/2
    Update the crayfish position according to Equation (8)
   Else
    Update the crayfish position according to Equation (9)
   End
  End
  Update fitness values, XGbest, XLbest
  t = t + 1
End while