Research Article

A Learning Sparrow Search Algorithm

Algorithm 1

The framework of the LSSA.
Input
M: Maximum number of iterations
PD: Discoverer
SD: Individuals who are aware of the danger
R2: Alert value
N: Population sparrows
Output: Xbest,
Initialize population
t = 1;
While (t < M)
Find the position of the best and worst sparrow individuals according to fitness values.
R2 = rand(1)
For i = 1 : PD
Update the location of the discoverers according to formulas (1) and (7);
End for
Update the worst location found by the discoverer according to formula (8);
For i = (PD + 1) : N
Update the location of the followers according to formulas (2) and (9);
End for
For l = 1 : SD
Get the individual position of a sparrow that is aware of danger according to formula (3);
End for
Get the Location of the New Optimal Individual;
Update the individual location according to formulas (12)–(14);
t = t + 1
End while
Return: Xbest,