Skip to main content
. 2020 Feb 7;20(3):889. doi: 10.3390/s20030889
Algorithm 1: The Task Allocation Algorithm
1. Input: List of terminals positioning requests and list of edge nodes
2. Output: Minimum service delay
3. InitializeV,E,U,ri
4. Calculateφ and ΔCi for iV
5. For all i in edge nodes, iV
6. Initialize ΔCi,cp,pc,CHROMOSOME,ITERATION
7. Initialize the first generation chromosome
8. While iteration<ITERATION do
9.   Calculate fitness fk of each chromosome in the previous generation
10.   Calculate natural selection probability Pk
11.   Copy top 20% best individuals into next generation directly
12.   The roulette algorithm is used to selection operation for the remaining individuals
13.   Crossover operator
14.   Mutation operator
15.   Calculate the optimal allocation scheme and task processing time in this iteration
16.   Generate the next generation chromosomes
17. End While
18. End For
19. Calculate service delay of the whole system
20. Return the optimal solution of service delay