|
Algorithm 2: Firefly algorithm based NBSs selection |
| 1: |
Initialize population
|
| 2: |
Perform the generation of initial firefly population, (1,2,…i) |
| 3: |
Calculate the light intensity I at using Equation (7) and obtain the . |
| 4: |
While t < MAXGeneration |
| 5: |
For every i |
| 6: |
For every j |
| 7: |
update fitness function and find light intensity. |
| 8: |
For
|
| 9: |
If >
then
|
| 10: |
Replace with updated firefly. |
| 11: |
Else Randomly change function and generate new intensity. |
| 12: |
End If |
| 13: |
End For |
| 14: |
Determine the new solution using Equation (8) and update the light intensity. |
| 15: |
End For |
| 16: |
End For |
| 17: |
Make a ranking of the fireflies to locate the present best. |
| 18: |
End While |