## 4 The Cloud-Enabled Emergency Navigation System
### Coordinated Emergency Navigation  
As emergency navigation systems always perform in harsh physical environments, the likelihood of the malfunction of components is relatively high, and the coordinated behaviour of evacuees can facilitate building a fault-tolerant framework. For example, the battery power of a smart phone can be depleted during an evacuation process. In this case, a single evacuee can be trapped owing to being unaware of the physical location. Coalition in evacuation can avoid this by increasing the likelihood of following other evacuees in proximity to exits. Furthermore, emergency navigation systems involve many data flows for information acquirement and dissemination. Therefore, evacuating in a cooperative manner can realise energy efficiency by relaying data or providing alternatives, such as opportunistic communication, when the main communication mode fails. Another advantage of evacuating in teams is to provide better QoI by merging the overlapping information. Hence, in this section, we leverage the SPF to cluster evacuees into groups during an evacuation. \begin{table}
\begin{tabular}{|c|c|} \hline
**Notation** & **Definition** \\ \hline \(RNN_{new}\) & A Boolean value to indicate if a RNN is newly constructed or reset \\ \hline \(R\) & A random generated value between 0 and 1 \\ \hline \(N_{m}\) & The total number of SPs that can be emitted before sending a photo \\ \hline \(N_{c}\) & The number of SPs that has been emitted in a cycle \\ \hline \(H_{m}\) & The maximum number of hops a SP can traverse before being dropped \\ \hline \(H_{c}\) & Current traversed number of hops \\ \hline \(V_{Drift}\) & Probability to choose the neighbour associated with \\  & the most excited neuron as the next hop \\ \hline \(V_{SPN}\) & Probability to choose the SPN-based algorithm \\ \hline \(P^{i}_{Bluetooth+3G}\) & Path availability (calculated by Formula 3) \\  & of transmitting a snapshot via the current route \\ \hline \(P^{i}_{3G}\) & Path availability of conveying a snapshot via 3G mode \\ \hline \end{tabular}
\end{table} 
Table 2: List of symbols used in the Pseudocode 2. SP, smart packet. ```
1:while an evacueue reaches a landmark do
2: Collect in situ hazard information with smart phone's built-in camera
3: Sense other smart phones in the near-field communication range
4:if the neighbouring smart phones has changed then
5: Reset the RNN structure in the AHCPN-based energy management module
6: Set \(RNN_{new}\gets true\)
7:endif
8: /* Emit \(N_{m}\) SPs to search energy-efficient communication routes */
9:while\(N_{c}<N_{m}\)do
10:while\(H_{c}<H_{m}\)do
11: Generate a random value \(R\) between 0 and 1
12:if\(R>V_{Drift}\)\(\&\)\(-RNN_{new}\)then
13: Choose the neighbour associated with the most excited neuron as the next hop
14:else
15: Choose a random neighbour as the next hop
16:endif
17: /* When a SP reaches a new smart phone */
18:if\(P_{Bluetooth+3G}^{i}\geqslant P_{3G}^{i}\)then
19: Stop searching and transmit the SP to the cloud access point via 3G
20:else
21: Check the current discovered route in the cognitive map of the SP
22:if all of the neighbours of the current smart phone have been visited then
23: Stop searching and convey the SP to the cloud access point via 3G
24:else
25: Add the current smart phone to the cognitive map of the SP
26:endif
27:endif
28:endwhile
29: Generate an ACK to bring back gathered delay and energy information
30:endwhile
31: Choose the top ranked path \(P\) in the routing list to send the snapshot
32: Cloud severs employ image processing algorithms to identify the location of the evacuee and the hazard intensity
33: Update the related hazard situation in the building graph
34: Generate a random value \(R\) between 0 and 1
35:if\(R>V_{SPN}\)then
36: Choose the decision made by the CPN-based algorithm
37:else
38: Choose the decision made by the SPN-based algorithm
39:endif
40: Send the decision back to the evacuee through the reverse of path \(P\)
41:endwhile
```
**Pseudocode 2** The workflow of the system.