Table 2 Pseudo-code of the proposed SSA-PSO method.

From: Optimization of a two-stage emergency logistics system considering public psychological risk perception under earthquake disaster

SSA-PSO algorithm

Input:

The initial solution set X, X=[Xsparrows, Xparticle], setting the population size of sparrows and particle swarms, the number of iterations and other parameters, the fitness function F

Output:

Xbest

Set1:

sort Xsparrows and Xparticle according to F

Set2:

while the number of iterations is not greater than the number of terminations

 

updates the location of spotters, followers, and scouts

 

sort Xsparrows according to F

 

dynamic backward mutation of Xsparrows0

 

if F(Xsparrows0) > F(Xnew)

 

Xsparrows0 = Xnew

 

else continue

 

if F(Xsparrows0) < F(Xparticle0) then

 

insert Xsparrows0 into Xparticle to become Xparticle0

 

update the position and velocity of X

 

sort Xparticle according to F

 

Xbest= Xparticle0

 

else Xbest= Xparticle0

 

end while

Set3:

output Xbest