Binary bat algorithm
1: | Set the initial value of swarm size SS(N), a, r, Q min, Qmax and maxiter. |
2: | Randomly initialize the population as xi = (xi1, xi1,… , xiD) ∈ S for each solution, the frequency vectors Q as D dimensional zero vectors as in Eq. (3) and the velocity vectors v as D dimensional zero vectors as in Eq. (4). |
3: | Evaluate fitness of each solution using Eq. (2). |
4: | Initialize fitness as D dimensional zero vectors. |
5: | Store the best solution in best and minimum fitness in Fmin |
6: | Set t := 0. {Counter initialization} |
7: | for(i = l;j <SS;i + +) do |
8: | for(j = 1; J < D; J + +) do |
9: | Qi = Q min + (Qmin — Qmax) • rand |
10: | v(i, j) = v(i,j) + (x(i, j) - best(j)) • Qi |
11: |
|
12: | Binarize |
13: |
|
14: | if(rand < V_ value) then |
15: |
|
16: | else |
17: | xtemp (i,j) =x(i, j) |
18: | end if |
19: | if(rand > r) then |
20: | xtemp (i,j) = best(j) |
21: | end if |
22: | end for |
23: | fit = fitness of xtemp. |
24: | if(fit < Fmin & rand <a) then |
25: | x(i) = Xtemp (i) |
26:. | update fitness |
27: | end if |
28: | update best and Fmin. |
29: | end for |
30: | t = t +1 {Iteration counter is increasing} |
31: | until(t <maxiter) {Termination criteria are satisfied}. |
32: | Produce the best solution best. |
1: | Set the initial value of swarm size SS(N), |
2: | Randomly initialize the population as |
3: | Evaluate |
4: | Initialize |
5: | Store the best solution in |
6: | Set |
7: | |
8: | |
9: | |
10: | |
11: | |
12: | Binarize |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | |
23: | |
24: | |
25: | |
26:. | update fitness |
27: | |
28: | update |
29: | |
30: | |
31: | |
32: | Produce the best solution |
Sharing content requires targeting cookies to be enabled. Please update your cookie preferences to use this feature.