Skip to main content
. 2023 Feb 3;23(3):1722. doi: 10.3390/s23031722
Algorithm 3 Pseudocode of DBOA.
1:
                 Initialization part.
2: Determine parameters of BOA algorithm. N—number of butterfly in population, n—dimension, c—sensor modality and a, ξ, p parameters.
3: Random generate starting population {x1,x2,…,xN}.
4: Calculate the value of the fitness function F (hence intensity of the stimulus I=F) for each butterfly xk(k=1,2,…,N) in population.

             Iterative part.
 for iterationi=1,2,…,I do
   for k=1,2,…,N do
    Calculate value of fragnance for xk with the use of Equation (13).
5:    end for
    Set the best agent xbest among the butterflies.
    for k=1,2,…,N do
    Set a random number r from range [0,1].
     if r<p then
10:      Convert solution xkt in accordance with the Equation (14).
     else
        Convert solution xkt in accordance with the Equation (15).
     end if
   end for
15:  Change value of the parameter a.
   Adopt the LSAM algorithm to convert the agents population with mutation rate ξ.
 end for
 return xbest.