Skip to main content
. 2021 May 23;21(11):3623. doi: 10.3390/s21113623
Algorithm 1 Improved salp swarm algorithm.
  • 1:

    Initialization parameters: population size N, dimension d, maximum number of iterations T.

  • 2:

    Generate the initial population X by Equation (1);

  • 3:

    Calculate the fitness value for each individual;

  • 4:

    whilet<=Tdo

  • 5:

        Update c1 by Equation (3) and r1 by Equation (8);

  • 6:

        for i=1:n do

  • 7:

            if Xi(leader) then

  • 8:

               Update random numbers c2 and c3;

  • 9:

               Update the position of the leader salp as in Equation (2);

  • 10:

            else

  • 11:

               Update random numbers r2, r3 and r4;

  • 12:

               Update the position of the follower salp as in Equation (7);

  • 13:

            end if

  • 14:

            Calculation Dop using Equation (9);

  • 15:

        end for

  • 16:

        if δ0>0.5 then

  • 17:

            X=X·Dop;

  • 18:

        end if

  • 19:

        Set t=t+1;

  • 20:

    end while

Output: Best classification and predication results.