|
Algorithm 1 Cuckoo search algorithm |
|
Input: (n, p, kmax) |
|
Output:
x
0
|
| 1: Randomly initialize n candidates
|
| 2: Calculate the error of each candidate
|
| 3: Sort the population in ascending order of error
|
| 4: for () do
|
| 5: for () do
|
| 6: Randomly pick a candidate with error
|
| 7: Generate by mutating using Equation (6) |
| 8: Calculate error of
|
| 9: if () then
|
| 10: Replace with
|
| 11: end if
|
| 12: end for
|
| 13: Sort the population in ascending order of error
|
| 14: Randomly initialize worst candidates |
| 15: end for
|