Skip to main content
. 2023 Aug 29;23(17):7508. doi: 10.3390/s23177508
Algorithm 3 Parallel strategy for unidirectional ring topology
  • 1:

    for  g=1:4  do

  • 2:

        Use g+1 to find the remainder of 4 and record the remainder as sg

  • 3:

        if sg==0 then

  • 4:

            sg=4

  • 5:

        end if

  • 6:

        if The fitness value of the optimal particle in group g > The fitness value of the optimal particle in group sg then

  • 7:

            Replace the optimal particle position and its fitness value of group g with the optimal particle position and its fitness value of group sg

  • 8:

        else

  • 9:

            Disturb the optimal particle of group g and calculate its fitness value

  • 10:

        end if

  • 11:

        if Particle fitness value after perturbed < The optimal particle fitness value of group g then

  • 12:

            Use the perturbed particle position and its fitness value to replace the optimal particle position and its fitness value of group g

  • 13:

        end if

  • 14:

    end for