Skip to main content
. 2022 Jun 3;22(11):4275. doi: 10.3390/s22114275
Algorithm 1 OPGTOS1
Input: The maximum number of iterations T, the population size N, the lower boundary lb, the upper boundary ub, the dimension dim, the objective function fobj;
1:  Initialization: Generate the individual Xi(i=1,2,,N).
2:  %Opposition-based learning
3:  Calculate the opposition-based individual Xi(i=1,2,,N) using Equation (14). Select N individuals with the best fitness from Xi and Xi;
4:  Divide the population into g groups, every group is Group(j)(j=1,2,,g);
5:  The best gorilla in each group is Group(j).silverback and its fitness value is Group(j).bestfit;
6:  t = 1;
7: while t < T do
8:      %Multi-group merge communication strategy
9:      if t == R then
10:          j = 0
11:          for i = 1:2:g do
12:             j = j + 1
13:             Merge groups
14:             %Update the optimal individual for each group
15:             Group(j).silverback = BestGorilla
16:             Group(j).bestfit = BestFitness
17:          end for
18:          g = g/2
19:      end if
20:      for i = 1:g do
21:          Update Group(i) using GTO
22:          Mutate Group(i).silverback using Equation (15)
23:          Select the best fit individual from Group(i).silverback and Group(i).silverback
24:          %Update the optimal individual for the entire population
25:          if Group(i).BestFitness<BestGorilla then
26:             BestGorilla=Group(i).silverback
27:             BestFitness=Group(i).bestfit
28:          end if
29:          if t > 100 then
30:             Opposition-based learning with sliding window strategy
31:          end if
32:      end for
33: end while
Output:BestGorilla and BestFitness.