## 4 Pheromone-Based Alarm Delivery Concept
### Trail-Search Mechanism  
In case an alarm is issued by a node that has no pheromone trace (\"0\" pheromone mark on it), a direction is randomly chosen and the alarm follows this direction until it finds a pheromone trail. When a pheromone mark is found in a node, it follows the respective trail as explained above. This situation is more likely to occur during system initialization, and in cases in which the number of UAVs deployed in the system is very low and/or the size of the trail is small in relation to the size of the mission area. This mechanism is called _trail-search_, which is illustrated in Figure 6.  
As can be observed in Figure 6a, while performing the trail search, an alarm follows the nodes towards a given direction, which is randomly chosen from the position of the alarm issuer node, until it reaches a trail or satisfies a given condition to change the direction of its forwarding. This condition can be defined as a number of hops or just by reaching the limits of the mission area, for instance. Considering the direction which the alarm follows in the trail-search, in the case in which the decision to change the forwarding direction is taken after a given number of hops, when arriving at a node that fulfils this condition, a new direction is defined as an angle \(\beta\). This angle is randomly chosen according to a uniform distribution in the interval (\(-\pi/2\), \(\pi/2\)) in relation to the current direction, as depicted in Figure 6b. If the alarm reaches a node that is located close to an edge that limits the operation area, a new direction in relation to this edge is defined as an angle \(\gamma\) randomly chosen according to a uniform distribution in the interval (0, \(\pi\)), as shown in Figure 6c. Notice that in the first case, in which the condition to change direction is determined by a number of hops, if the alarm does not find a trail and reaches one of the edges that limits the area, the same behavior presented in Figure 6c is taken. Figure 5: Trail-follow mechanism example used in the pheromone-based alarm delivery step by step from the alarm issuing towards its delivery: **(a)** Alarm issue; **(b)** Alarm propagation closer the alarm issuer node; **(c)** Alarm propagation proceeding; **(d)** Alarm propagation getting closer to the nodes in the range of the UAV; **(e)** Alarm delivery. The implementation of the trail-search mechanism can be done by using a simple greedy position-based routing mechanism [31]. The one adopted in this work considers the selection of the forwarding node based on the angle that the line that links the current node to a neighbour node forms with the reference direction. The node that has an angle closer to \(\beta\) is selected to proceed with the alarm forwarding process. When an alarm reaches a node that is placed in a position closer than one communication range from one of the edges that limit the operation area, it is considered that the alarm reached a limit edge, and thus a new angle is chosen, as seen in Figure 6c. The trail-search mechanism is also performed in cases in which the network is disconnected and the alarm was performing a trail-follow, but it reaches a limit of a partition of the network and is not able to proceed following the trail in the right direction. Then it starts a trail-search in an attempt to find another trail. While the alarm is performing the trail-search towards a given direction and then reaches a situation in which it gets stuck due to network disconnection, it will select a new direction to proceed with the trail-search. This behavior is similar to the behavior of an alarm that reaches a limiting edge of the operation area. The pheromone marks stored by the ground sensor nodes have two components: a temporal and a spatial one.