Skip to main content
. 2024 Mar 20;9(3):187. doi: 10.3390/biomimetics9030187
Algorithm 1: Pseudocode of the BGOA-TVG algorithm.
Initialize Cmax, Cmin, and Max_Iterations
Initialize a population of solutions Xi (i = 1, 2, …, n)
Evaluate each solution in the population
Set T as the best solution
While (t < Max_Iterations)
     Update c using Equation (9)
     For each search agent
          Normalize the distances between grasshoppers in [1, 4]
          Update the step vector ΔX of the current solution using Equation (10)
          For i = 1: dim
                Use Equation (8) to obtain the current position
                Use Equations (10)–(13) to obtain the binary position
                Use Equations (14)–(17) to obtain the final position
                Calculate α,β,sigma based on Equations (13), (15), and (16)
          End
          Reevaluate the fitness of each individual in the population
          If there is a better solution, replace T with it
          Update T
     End
End
Return T