Skip to main content
. 2021 Jul 8;23(7):874. doi: 10.3390/e23070874
Algorithm 9 GSA
  • Input: the parameters M, N, δ, G0, α

  • Begin

  • S1: initialize M particles xi(t) randomly, 0<iM, iterative times t = 1;

  • S2: compute f(i), 0<iM, update pg(t); if it satisfies (t > N or precision δ), then go to step S4; otherwise, go to step S3;

  • S3: update G(t) by Equation (25), update best(t) and worst(t) by Equation (31), update Ii(t) by Equation (30), calculate Fid(t) by Equation (27), compute aid(t) by Equation (28), update vi,d(t+1) and xi,d(t+1) by Equation (29), iterative times t = t + 1; go to step S2;

  • S4: output the optimized results.

  • End