Skip to main content
. 2019 Nov 20;19(23):5072. doi: 10.3390/s19235072
Algorithm 1: pseudo code for LMO in SARP.
Input: Generate a random population of Lions, i.e., sensor nodes (S𝒾) in a search space (𝒾)
Output: Cluster-based routing solution for BASNs.
Procedure: Initialize all sensor nodes with the parameters given in Table 3
  • 1. 

    Begin the iterative methodology and set the round number = 𝓉+

  • 2. 

    While (number of generations) do

  • 3. 

    Initialize all members of prides and nomad lions on the problem search space.

  • 4. 

    Select a percentage of the nomads N and the resident lions such that N=+ N.

  • 5. 

    Both lioness and lion are selected for hunting a prey, randomly.

  • 6. 

    For each lion do

  • 7. 

    Compute the fitness

  • 8. 

    End for

  • 9. 

    If the fitness of a lion is greater than other lion in a pride Then

  • 10.

    Update the lion in the pride in the problem search space

  • 11.

    For each lion do

  • 12.

    Try mating behavior

  • 13.

    A percentage of nomad females mate with the best males

  • 14.

    In each pride, a ratio of sex rate (S) is applied to (𝒾) and (𝒿) to produce new cubs

  • 15.

    If no improvement in fitness value then

  • 16.

    Try territorial defense behavior

  • 17.

    If no improvement in fitness value then

  • 18.

    Try territorial takeover behavior

  • 19.

    This ratio is inverted in nomad lions.

  • 20.

    End if

  • 21.

    End if

  • 22.

    End while

  • 23.

    For each pride

  • 24.

    Both of male and female search randomly in the search space.

  • 25.

    Nomad males attack prides randomly.

  • 26.

    End for

  • 27.

    For each bride

  • 28.

    Some randomly selected female emigrates from the pride and becomes a nomad.

  • 29.

    End for

  • 30.

    Each gender of nomad lions is sorted according to their fitness value.

  • 31.

    The best females are distributed to the prides to fill the empty places of the immigrated females.

  • 32.

    Compare and swap the weak lions with best fitness values lions.

  • 33.

    Memorize the best solution

  • 34.

    While (next generation until stopping criteria not met) do

  • 35.

    Send control to line 1 such that 𝓉<𝓉+1, Else

  • 36.

    Return the best solution

  • 37.

    End procedure