Research Article
Reorganizing Complex Network to Improve Large-Scale Multiagent Teamwork
Algorithm 1
Coordination decision process.
(1) ApplicableTasks , OwnTasks , Holds , Messages ; | (2) while (true) do | (3) for ( agent & ApplicableTasks) do | (4) if (Applicable()) then | (5) ApplicableTasks.append(); | (6) Messages.append(CreateMessages()); | (7) end if | (8) Messages.append(recvMessages()); | (9) end for | (10) for ( Messages) do | (11) if ( is TaskMessages()) then | (12) if (GetCap() .threshold) then | (13) if ( OwnTasks) then | (14) OwnTasks.append(); | (15) end if | (16) else | (17) SendToNeighbour(); | (18) end if | (19) else if ( is ResourceMessages()) then | (20) .threshold += ; | (21) if (GetNeed() .threshold) then | (22) if ( Holds) then | (23) Holds.append(); | (24) end if | (25) else | (26) .threshold −= ; | (27) SendToNeighbour(); | (28) end if | (29) end if | (30) CheckExecution(OwnTasks, Holds); | (31) end for | (32) for ( OwnTasks) do | (33) if ( is complete) then | (34) OwnTask.remove(); | (35) for ( ChkUnneed(OwnTask, Holds)) do | (36) Hold.remove(); | (37) SendToNeighbour(CreateMessages()); | (38) end for | (39) end if | (40) end for | (41) end while |
|