Skip to main content
. 2020 Apr 10;20(7):2147. doi: 10.3390/s20072147
Algorithm 2 Pseudo Code of FWA
1. Randomly select n locations for fireworks2. while stop criteria=flase do3.Set off n fireworks respectively at the n locations4.foreach fireworkxido5.  Calculate the number of sparks that the firework yields by equation (9)6.  Obtain locations of each sparks of the fireworkxi7.end for8. for k=1:number of Gaussian sparks do9.  Randomly select a fireworkxj10.  Generate a Gaussian spark for the firework11. end for12. Select the best location and keep it for next explosion generation13. Randomly select n1 locations from the two types of sparks and the current fireworks14. according to the probability given in equation (15)15. end while