Skip to main content
. 2020 Jan 13;20(2):441. doi: 10.3390/s20020441
Algorithm 2: Initial Task Scheduling
    Input: vi:task to schedule
1  PList[vi ∈ N, j ∈ M];
2  begin
3      Qvm ←Sort the fog serves by the cij with the descending order;
4      V ← NULL;
5      foreach VjQvm do
6          Tj,0 ← 0;
7      foreach VjQvm do
8          Calculate the Tie of Vj by the Equation (4);
9          if Tj,i -1 + Tie < di then
10          Calculate the Tj,i of Vj by the Equation (3);
11          Z Vj;
12          break;
13      Calculate cost of Z by the Equation (1);
14      PList[vi ∈ N, j ∈ M] ← Z;
15      return Z, V;