Skip to main content
. 2020 Dec 26;21(1):111. doi: 10.3390/s21010111
Algorithm 2: TASP Algorithm
Begin
Initialize the value of all the decision variables to be zero, and the node position of the evacuating person be the start node;
  Construct the nodes and links in the 2-D planar graph;
  Let the node position of the evacuating person be the start node;
  While (t|T|) //looping at each time slot t
  Begin
Collect the temperature data at each node and the link cost data at each link at time slot t;
Remove the link L from set L if the link temperature is over the upper limit of human temperature tenability M; //avoiding traverse to a node with temperature more than M on the evacuation path
Calculate the shortest path from the start node to every exit node by using Dijkstra’s algorithm; //Step 3
Let σ = 0;
For every exit eE
Begin
If there is the best path to exit eE
Begin
Let λe= the best path cost to exit eE;
σ = 1;
End //if
End //For
   If (σ == 0)//cannot find any best path to all the exits
   Begin
    Report no feasible solutions;
   Break from the While loop;
  End //If (σ == 0)
  Else //at least there is the shortest path to exit
Let λ˜=Min ArgeEλe; //the exit number that has the smallest shortest path cost, evacuation path is the best path to exit λ˜
If (the hop distance from the start node to the exit number λ˜ on the evacuation path Λ) //reach the exit
Begin
Let Ω = Ω + (The link cost from the start node to the exit λ˜ on the evacuation path);
Report Ω and the evacuation path;
ρ = 1;
Break from the While loop;
End // If (the hop
Else // have not reached the exit, then move the start node Λ hop distance closer to exit λ˜ on the emergency path
Begin
Let Ω = Ω + (All the link cost from the start node to the node with hop distance Λ on the evacuation path);
Move the start node to the new position with Λ hop distance on the evacuation path;
End // Else
End;//While loop
If (ρ == 0)
  Report no feasible solutions;
End