Begin |
Population initialization |
Step 1. Set population size CS, the number of food sources , the non-improvement number of food source , |
the number of maximum iterations , and the number of parameters . |
Step 2. Generate initial solutions using population initialization based on SSD as in (5) and (6), and calculate their fitness |
values by (7) and (8). |
Step 3. cycle = 1 |
Step 4. While cycle ≤ do |
Employed bee phase |
For = 1 : do |
Update the position of the employed bee based on (3). |
Check whether it is out of boundaries or not. |
Calculate fitness value by (7) and (8). |
A greedy selection strategy is applied to select the better food source. |
A food source doesn’t improve = + 1, otherwise = 0 where represents |
the number of the th trial. |
End for |
Onlooker bee phase |
Step 5. Calculate based on (9), and initialize = 0, = 0. |
While < then do |
If random < then do |
Update the position of the onlooker bee by (3). |
Check whether it is out of boundaries or not. |
Calculate fitness value by (7) and (8). |
A greedy selection strategy is applied to select the better food source. |
A food source doesn’t improve = + 1, otherwise = 0. |
End if |
End while ( = ) |
Scout bee phase |
Step 6. if > then do |
Generate a new food source for the scout bee by (10). |
End if |
Step 7. Memorize optimal solution achieved till now. cycle = cycle + 1; |
Step 8. End while (cycle = ) |
End. |