INPUT: Edge distance(obstacles), pheromones, ants’ trail, associated probabilities, |
starting and terminating indexes that is, from F or C |
OUTPUT: Effective cooperation, inspection and navigation |
(1) Boolean CompletedFlag = False //Boolean variable indicates completion for all the threads |
(2) Declare CompletedThreadBuffer //Data structure stores Info about completed thread |
(3) Initialize all values to Zero //All values positions are initialized to zero |
(4) Initialize Best Paths From ACO algorithm //starting from and |
(5) While (CompletedFlag <> True) //Checks for when all robots have finished and flag is true |
Begin |
Create N number of Threads in Parallel |
Threads get Current States in Parallel from ACO algorithm |
Threads get Next States and Indexes in Parallel from ACO algorithm |
Threads compare values of all corresponding positions of Current States (Each Robot Broadcast |
value info) |
IF ((Q == 0) & (ThreadNextState <> GoalState)) //Checks if a particulate state is available |
Begin |
State is Available, Robot with the CurrentThreadID Inspects |
Compute and Update value |
End |
IF (Q > 0) //checks if a state is not available, because an already inspected state has > 0 |
Begin |
State is already inspected, Robot with the CurrentThreadID Ignore |
Compute and Update value |
End |
IF ((Q == 0) & (ThreadNextState == GoalState)) //Checks for goal state and shuts down. |
Begin |
Compute and Update value |
Goal state is reached and Inspection Completed |
Thread with the CurrentThreadID Shuts down |
Store CurrentThreadID in CompletedThreadBuffer |
End |
IF (Count [CompletedThreadBuffer] == NumberOfRobot) //Learning stops when this happens |
Begin |
CompletedFlag = True |
End |
End of While Loop. |