Enhanced PSO Algorithm
1: | Set the initial value of swarm size SS(N), acceleration constants c1 and c2, wmax, wmtn, vmax and maxiter. |
2: | Randomly initialize the population as x using Eq. (9) for each solution and the velocity vectors v as D dimensional zero vectors as in Eq. (10). |
3: | Set t := 0. {Counter initialization} |
4: | |
5: | Evaluate the fitness function for each of the solutions using f(xi) (Eq. (2)) and assign the values for Pbest and gbest. |
6: | for(i = l; i < SS; i ++) do |
7: | |
8: | end for{Update the velocities of Particles} |
9: | for(i= l; i < SS, i + +) do |
10: | for(j = 1; j <D;j + +) do |
11: | if(v(i,j) > vmax) then |
12: | v(i,j) = vmax |
13: | end if |
14: | if(v(i, j)< -vmax) then |
15: | v(i, j) = −vmax |
16: | end if |
17: | |
18: | if(rand < s) then |
19: | x(i, j) = 1 |
20: | else |
21: | x(i,j)=0 |
22: | end if |
23: | end for |
24: | end for |
25: | t = t +1 {Iteration counter is increasing} |
26: | until(t <mox iter) {Termination criteria are satisfied}. |
27: | Produce the best solution gbest. |
1: | Set the initial value of swarm size |
2: | Randomly initialize the population as |
3: | Set |
4: | |
5: | Evaluate the fitness function for each of the solutions using |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | Produce the best solution |
Sharing content requires targeting cookies to be enabled. Please update your cookie preferences to use this feature.