|
Algorithm 1 Timed Protocol for Cooperation with Disagreement Correction (code for ) |
-
1:
Constants:
-
2:
: the system vehicles.
-
3:
⊥: the unavailability symbol denotes a void entry, and the default return value.
-
4:
: the maximum offset among vehicles.
-
5:
D: the maximum time that a message time can live in the network.
-
6:
: round size
-
7:
Variables:
-
8:
: Current communication round.
-
9:
: Application data where is a set that consists of the current operative mode and the state of vehicle k at round r from member .
-
10:
Interface
-
11:
: Disseminate information to the members.
-
12:
: Dispatch arriving messages.
-
13:
: Return the state of the vehicle.
-
14:
: Computes the path according to the operational mode and the state of the system.
-
15:
Upon
-
16:
if
then
-
17:
for all
do
-
18:
if (
and
) or () then
-
19:
-
20:
end if
-
21:
end for
-
22:
end if
-
23:
loop
-
24:
if
then
-
25:
-
26:
end if
-
27:
if
then
-
28:
-
29:
-
30:
-
31:
if
then
-
32:
-
33:
end if
-
34:
-
35:
-
36:
end if
-
37:
end loop
|