|
Algorithm 1 Proposed RHSOFS Algorithm |
Create an initial population of 0 & 1 of P agents randomly.
Set the dimension of the problem, D = P, where P is the number of agents.
Set Low to 1 and High to D, where Low and High refer to the low and high dimensions, respectively.
Generate the value of r1 and r2, where r1 is a random number (0, 1) and r2 is a random radius (0, 360).
Generate training and testing data.
Set max_iter = maximum number of iterations.
Calculate each agent’s fitness using Equation (3).
Set Leader = the best agent.
Set t = 1.
while (t < max_iter)
for (i = 1 to n) do
Update Leader position, according to Equation (4).
Update the position of each search agent according to Equation (5).
Calculate Newfitness of each search agent using Equation (3).
Select the best member of the population → bestX = X (min (fitness))
Update the angle according to Equations (9) and (10).
If (Newfitness (i) <= fitness (i); then
Update the position of each search agent according to Equation (5).
fitness (i) = Newfitness (i).
end if
end for
t = t + 1.
end while
Return the best agent
|