Research Article
An Adaptive Bacterial Foraging Optimization Algorithm with Lifecycle and Social Learning
Pseudocode 2
Pseudocode of BFOLS algorithm.
| 1 Initialization | | 2 While (termination conditions are not met) | | 3 size of the last population; ; | | 4 while | | 5 ; | | 6 | | 7 Generate a tumble angle for bacterium ; | | 8 Update the position of bacterium by (2.1); | | 9 Recalculate the | | 10 Update personal best and global best; | | 11 | | 12 While () | | 13 If | | 14 | | 15 Run one more step using (2.1); | | 16 Recalculate the ; | | 17 Update personal best and global best; | | 18 ; | | 19 Else | | 20 ; | | 21 End if | | 22 End while | | 23 If (Nutrition () is larger than split threshold value) | | 24 Split bacterium into two bacteria; Break; | | 25 End if | | 26 If (Nutrition () is less than dead threshold value) | | 27 Remove it from the population; | | 28 ; ; Break; | | 29 End if | | 30 If (Nutrition () is less than 0 and ) | | 31 Move bacterium to a random position; | | 32 End if | | 33 End while | | 34 End while |
|