Skip to main content
. 2022 Dec 6;22(23):9546. doi: 10.3390/s22239546
Algorithm 1:IPWOA

Input: tasks J, computing resources S, tmax

Output: BestAllocation

1: Set t=0, set number of tasks tasksNum, set tmax, searchNo, allocation plan P;

2: Initial each allocation plan P using Equation (22);

3: Calculate the fitness of each allocation plan P using Equation (14);

4: Best allocation bP = the best allocation plan;

5: While t<tmax

6:    Update a, A, C, l, p;

7:    For i=0 to tasksNum:

8:       if p<0.5

9:          if A<1

10:             Update resource allocation plan P using Equation (24);

11:          else

12:             Update resource allocation plan P using Equation (20), Equation(21);

13:       else

14:          if A<1

15:             Update resource allocation plan P using Equation (25);

16:          else

17:             Update resource allocation plan P using Equation (19);

18:    Check if any distribution plan the search space and amend it;

19:    Calculate the fitness of each distribution plan using Equation (14);

20:    Update the best allocation bP if there is a better solution;

21:    t=t+1;

22: return best allocation bP