(1) set control parameters: SN, Max.iter, limit, , , , . |
(2) Generate initial population //Use (1). |
(3) Evaluate initial population //Calculate , record local and global best. |
(4) set iter = 1 |
(5) for each food source do, Set end for |
(6) do while iter ≤ Max.iter |
(7) //EMPLOYED BEE PHASE |
(8) for each food source do |
(9) Generate a neighbor solution from by Algorithm 2. |
(10) Make a selection between and by Algorithm 1. |
(11) end for |
(12) //ONLOOKER BEE PHASE |
(13) Calculate cumulative probability values //Use (3). |
(14) set , |
(15) while < PopSize do |
(16) Produce random number within the range 0, 1 |
(17) if then |
(18) set |
(19) Generate a neighbor solution from by Algorithm 2. |
(20) Make a selection between and by Algorithm 1. |
(21) end if |
(22) set |
(23) if > PopSize then set end if |
(24) end while |
(25) //SCOUT BEE PHASE |
(26) set = index of maximum(trial) //Find the index that has the maximum trial value. |
(27) if limit =< then |
(28) Replace with a new randomly generated solution //Use (1) |
(29) set |
(30) end if |
(31) Save necessary information //Record local and global best. |
(32) set iter = iter + 1 |
(33) end while |