Skip to main content
. 2024 Feb 15;9(2):117. doi: 10.3390/biomimetics9020117
Algorithm 3 BSO-II
  • 1:

    Initialization: Randomly generate an individual x=(x1,x2,,xn)Rn based on uniform distribution;

  • 2:

    while stopping criterion is not satisfied do

  • 3:

       Randomly generate a value Pb from 0 to 1 based on uniform distribution;

  • 4:

       if Pb is smaller than a pre-determined probability Pb then

  • 5:

           replace x with a randomly generated individual b=(b1,b2,,bn) based on uniform distribution;

  • 6:

       end if

  • 7:

       if Pb<Pb then

  • 8:

           y=b+z, where z is a mutation operator;

  • 9:

       else

  • 10:

         y=x+z;

  • 11:

      end if

  • 12:

      if y has better fitness than x then

  • 13:

          replace x with y

  • 14:

      end if

  • 15:

    end while

  • Output: 

    x