|
Algorithm 2 Local Foraging Behavior of an Ant |
-
1:
if
then
-
2:
Increment memory counter:
-
3:
Create a new hunting site near the nest
-
4:
-
5:
▹ Failure counter
-
6:
end if
-
7:
Let be the last visited site
-
8:
if
then
-
9:
Randomly choose another site from memory
-
10:
end if
-
11:
Perform local exploration:
-
12:
if
then
-
13:
Update site:
-
14:
-
15:
else
-
16:
Increment failure counter:
-
17:
if then
-
18:
Remove from memory
-
19:
-
20:
end if
-
21:
end if
|