Skip to main content
. 2026 Aug 12;11(8):576. doi: 10.3390/biomimetics11080576
Algorithm 3 Pseudocode of the DLO algorithm
  •   1:

    Initialize DLO parameters and initialize the population.

  •   2:

    Calculate the fitness value of the agents

  •   3:

    Update global optimal fitness value fgbest and the optimal individual position xbest→

  •   4:

    while t<Tmax do

  •   5:

          for i←1 to N do

  •      

                 Exploration phase

  •   6:

                if t<Tmax2 then

  •   7:

                     A=round1+rand(0,1)

  •   8:

                     initialize the direction vector DL→

  •   9:

                     for j←1 to D do

  • 10:

                         update DL(j)

  • 11:

                     end for

  • 12:

                     if xbest→i>xbest→m then

  • 13:

                         x→i(t+1)=xbest→i+r·x→m(t)−A·xbest→i+DL→·r·x→m(t)−x→n(t)

  • 14:

                     else

  • 15:

                         x→i(t+1)=xbest→i+r·xbest→i−x→m(t)+DL→·r·x→m(t)−x→n(t)

  • 16:

                     end if

  •      

                 Exploitation phase

  • 17:

                else

  • 18:

                     update Lévy flight search strategy

  • 19:

                     if rand(0,1)<p then

  • 20:

                         x→i(t+1)=gbest→+levy(D)·gbest→−x→l(t)

  • 21:

                     else

  • 22:

                         x→i(t+1)=gbest→+g·1−tTmax·xbest→i−x→l(t)

  • 23:

                     end if

  • 24:

              end if

  • 25:

              update xbesti→ using greedy selection strategy

  • 26:

              update gbest→ using greedy selection strategy

  • 27:

          end for

  • 28:

          t=t+1

  • 29:

    end while

  • 30:

    Output: the global optimal fitness value fgbest and the global optimal position gbest→