Research Article

Swarm Robot Exploration Strategy for Path Formation Tasks Inspired by Physarum polycephalum

Algorithm 2

Extinction mechanism.
counter_l ← 0//counterl is used to record the time when Robot_Explorer does not exist around
counter_2 ← 0//counter2 is used to record the time when Robot_Explorer exists around
Flag_Contraction ← False//Flag_Contraction is used to determine whether this branch is in a contracted state.
loop
if C_Node = null then//this Robot_Node is at the end of the branch.
for all neighbors n do
  if state(n) = Robot_Explorer then
   counter_2 ++
   counter_1 = 0
   break
if Do not exist Robot_Explorer in all neighbors n then
  counter_l ++
  counter_2 = 0
//Robot_Explorers can expand on this branch but they do not exist at the end for a long time.
if counter_l > PERIOD_TIME_1 and Flag_Contraction = False then
  state ← Robot_Lost
//No child nodes generated for a long time
if counter_2 >PERIOD_TIME_2 and Flag_Contraction = False then
  Flag_Contraction = true
  transmit Flag_Contraction (self)//pass the message that this branch is in a contracted state.
  state ← Robot_Explorer
//Robot_Explorers cannot expand on this branch and they do not exist at the end of it.
if counterl. >PERIOD_TIME_1 and Flag_Contraction = true then
//Keep the last Robot_Node as a marker. Do not repeat the search in this area.
if Root_ID(self) ≠ ID(P_Node) then
   state ← Robot_Explorer
else//not at the end of branch
for all neighbors n do
  if ID (n) = C_Node and Root_ID (n) = Root_ID (self) then
   Flag_Contraction (self ← Flag_Contraction (C_Node)
   transmit Flag_Contraction (self)
   break