|
Algorithm 1. Pseudo-code of CEFO algorithm |
|
/* Part 1: Algorithm parameters initialization */
|
| : The number of electromagnets in each electromagnetic particle. |
| : The number of electromagnetic particles in population. |
| : The probability of changing one electromagnet with a random electromagnet. |
| : The probability of selecting electromagnets from the positive field. |
| : The portion of particles belonging to positive. |
| : The portion of particles belonging to negative. |
| min = lower boundary; max = upper boundary |
|
/* Part 2: Main loop of the algorithm */
|
| for
i = 1 to
do
|
| for
j = 1 to
do
|
| position [i, j] = min + rand ( )(max − min) |
| end for
|
| end for
|
| Update position by using the chaotic map of Equation (5) |
| fitness = function (position) |
| while t (current iteration) < max iterations |
| Divide the electromagnetic field into three regions |
| for
i = 1 to
do
|
| if rand (0,1) >
|
| Generate the by Equation (4) |
| else
|
| Generate the from positive particles |
| end if
|
| Check if any particle beyond the search space |
| end for
|
| if rand (0,1) <
|
| Change one electromagnet of randomly |
| end if
|
| Compare the fitness of with worst particle |
| t = t + 1 |
| end while
|
| Output the best particle |