Skip to main content
. 2023 Nov 11;8(7):540. doi: 10.3390/biomimetics8070540
Algorithm 1 TSA pseudo-code
Step 1: The initialization of the algorithm
 Randomly generate tree locations on the D-dimensional search space using Equation (3).
 Evaluate the tree locations by the fitness function.
 Select the best location using Equation (4).
Step 2: Search with seeds
FOR all trees
  Decide the number of seeds produced for this tree.
  FOR all seeds
   FOR all dimensions
    IF (rand < ST)
     Update this dimension using Equation (1).
    ELSE
     Update this dimension using Equation (2).
    END IF
   END FOR
  END FOR
  Select the best seed and compare it with the tree.
  If the seed location is better than the tree location, the seed substitutes for this tree.
END FOR
Step 3: Selection of the best solution
 Select the best solution of the population.
If new best solution is better than the previous best solution, new best solution substi-tutes for the previous best solution.
Step 4: Testing the termination condition