Skip to main content
. 2024 Oct 1;9(10):595. doi: 10.3390/biomimetics9100595
Algorithm 1. Pseudocode of OCBKA
Inputs: the maximum number of iterations is T, the size of the population is N.
Output: optimal position, Xbest, and fitness value, F(Xbest).
  • 1.

    Initialize the population according to Equation (8) and specify the relevant parameters;

  • 2.

        While (tT) do

  • 3.

        Calculate the fitness value, F(Xi), for each individual in the population, and record the current optimal solution and optimal position;

  • 4.

        Update the values of parameters m and n.;

  • 5.

        for i = 1 to N do

  • 6.

            Update the position of the “underwater fish school” according to Equation (9);

  • 7.

            if r < p do

  • 8.

                update the current individual position according to Equation (10);

  • 9. 

            else if

  • 10.

                update the current individual position according to Equation (10);

  • 11. 

           end if

  • 12.

            perform Cauchy mutation according to Equation (5);

  • 13.

            if F(Xi) < F(Xri) do

  • 14.

                update the current individual position according to Equation (3);

  • 15. 

            else if

  • 16.

                update the current individual position according to Equation (3);

  • 17. 

            end if

  • 18. 

        end for

  • 19.

        if the position of the newly generated black-winged kite population is better than that of the original population, do

  • 20.

                update the position of the black-winged kite population;

  • 21. 

        end if;

  • 22.

    t = t + 1;

  • 23.

    end While

  • 24.

    return Xbest and F(Xbest).