Algorithm 1 Pseudocode of the developed AOAHG algorithm |
-
1:
Initialize the parameters.
-
2:
Split the dataset into training and testing sets after extracting the features.
-
3:
Initialize the number of solutions (N).
-
4:
repeat
-
5:
Determine the value of the fitness function.
-
6:
Find the best solution.
-
7:
Update the value using Equation (1).
-
8:
Update the value using Equation (3).
-
9:
Calculate the hunger weight of each position using Equations (9) and (10).
-
10:
Enhance using Equation (12).
-
11:
for to N do
-
12:
for to do
-
13:
Generate a random values in [0, 1] (, , and ).
-
14:
if > then
-
15:
Position limitations can be adjusted for new seeds.
-
16:
if > 0.5 then
-
17:
Update ith solutions’ positions by the first rule in Equation (2).
-
18:
else
-
19:
Update ith solutions’ positions by the second rule in Equation (2).
-
20:
else
-
21:
if > 0.5 then
-
22:
Update ith solutions’ positions by the first rule in Equation (22).
-
23:
else
-
24:
Update ith solutions’ positions by the second rule in Equation (22).
-
25:
until The iteration (t) criterion has been met.
-
26:
Return the best solution.
|