## 4 QoS Metrics  
The simplest metric used in the CPN-based algorithm in [47] is distance based, and it resolves the path with the shortest effective length, which is a compound metric with respect to path length and safety. Other novel metrics considered in this paper are the time metric, the energy efficiency metric and the safety metric. Previous work in [1] has proven that congestion formed at bottlenecks can temporally block evacuee fluids and has a severe impact on the performance of evacuation routing algorithms in high occupancy rates. Furthermore, congestion can impede QoS implementation by causing undesired time latency and extra energy consumption for electric powered wheelchairs. Hence, we include congestion in the new QoS metrics. Unlike previous congestion-aware algorithms, the algorithm that we proposed evaluates if the current congestion located at a certain node will affect an evacuee by comparing the duration of the congestion and the potential arrival instant of the evacuee. The congestion situation at a node when an evacuee reaches it depends on the current situation of the node and the total number of arrivals and departures before the evacuee arrives. To estimate the total number of arrivals and departures, we use the average arrival rate and departure rate recorded by each node. The details are given in Algorithm 1, and we assume that if the queue length of a node is larger than one, then congestion will occur. ```
0: A path \(\pi\) explored by SPs from a node, \(\pi(0)\) Result: The potential number of congestion situations encountered by an evacuee traversing across the path, \(\pi\)
1: Set the total number of congestion situations, \(C_{total}\), to zero
2: Set the total travel time, \(T_{total}\), to zero
3:for all the edges, \(e(\pi(i),\pi(i+1))\in\) path \(\pi\)do
4: /* Calculate the time cost on the edge, \(e(\pi(i),\pi(i+1))\) */
5:\(t_{edge}\leftarrow\frac{E^{e}(\pi(i),\pi(i+1))}{V_{speed}}\), where \(E^{e}(\pi(i),\pi(i+1))\) is the effective length of \(e(\pi(i),\pi(i+1))\), \(\pi(i)\) is the source node of the edge, \(\pi(i+1)\) is the destination node of the edge, \(V_{speed}\) is the average speed of a class of civilians. 6: /* Compute the time cost at the node, \(\pi(i)\) */
7:if\(q_{0}^{i}+\bar{\lambda}\cdot T_{\pi(i)}-\bar{\mu}\cdot T_{\pi(i)}>0\)then
8: /* If the congestion will remain there when the evacuee reaches the node, \(\pi(i)\), then plus the time delay caused by congestion */
9:\(t_{node}\leftarrow\frac{q_{0}^{i}+\bar{\lambda}\cdot T_{\pi(i)}-\bar{\mu}\cdot T _{\pi(i)}}{\lambda}\), where \(q_{0}^{i}\) is the current queue length of the node, \(\pi(i)\), \(\bar{\lambda}\) is the average arrival rate of the node, \(\pi(i)\), \(\bar{\mu}\) is the departure rate of the node, \(\pi(i)\), \(T_{\pi(i)}\) is the potential time cost to reach the node, \(\pi(i)\). Term \(\frac{q_{0}^{i}+\bar{\lambda}\cdot T_{\pi(i)}-\bar{\mu}\cdot T_{\pi(i)}}{\lambda}\) is the average time calculated by [PERSON]'s formula. 10: /* If the predicted queue length when the evacuee reaches it is larger than zero, the arrival of the evacuee will trigger congestion */
11:\(C_{total}\gets C_{total}+1\)
12:endif
13:\(T_{total}\gets T_{total}+t_{edge}+t_{node}\)
14:endfor
15:Return\(C_{total}\)
```  
**Algorithm 1** Predicting the potential amount of congestion encountered by an evacuee during the evacuation process. The time-oriented goal function pursues the shortest time cost to reach an exit and satisfies the QoS need of normal evacuees. The path traversal time is predicted as follows:  
\[G_{t}=\sum_{i=1}^{n-1}\{\frac{E^{e}(\pi(i),\pi(i+1))}{V_{speed}}+K[\frac{q_{0}^ {i}+\bar{\lambda}\cdot T_{\pi(i)}-\bar{\mu}\cdot T_{\pi(i)}}{\bar{\lambda}}]\} \tag{1}\]  
where \(\pi\) represents a particular path; \(n\) is the number of nodes on the path, \(\pi\); and \(\pi(i)\) is the i-th node on the path, \(\pi\). \(E^{e}(\pi(i),\pi(i+1))\) is the effective length of the edge between node \(\pi(i)\) and node \(\pi(i+1)\). \(V_{speed}\) is the average speed of this category of civilians.