Algorithm 1 Cleaning Path Generation |
-
1:
Step 1
-
2:
N is an array holds all the nodes position
-
3:
P is an array used to store the cleaning path
-
4:
= leftmost(N); Set uppermost left nodes as
-
5:
load =
-
6:
= def_goal(litter collection point); the function load the litter collection point as
-
7:
Step 2
-
8:
while cleaning path between to not discovered do
-
9:
Q, , are variable used for store the temporary value
-
10:
for
do
-
11:
Q= dfs_paths(, ); Explore the path between and nodes
-
12:
end for
-
13:
= backtrack.find(Q); the function find the backtrack node in the explored path
-
14:
= group.find(, ); the function collect intermediate node between and
-
15:
Path = def_PRM_node_connect(, , , , R); PRM function connect the nodes according to threshold function R
-
16:
plt.plot ()
-
17:
end while
-
18:
visited.add(); Mark all path identified node in N
-
19:
Store the path in P
-
20:
load = ; exclude path generate node from N
-
21:
set.new(); set new from updated N
-
22:
Run the Step 2 up-to generate the path for remaining nodes
|