|
Algorithm 1. STaSA |
| Input: p; Max_Loop; Ants_N; Q;
; ,
. |
|
Output: Placement of pod i on node j
|
| 1: Initialize parameters } |
| 2: If then |
| Instantiate new set of nodes using Equation (7) |
| //include check capacity condition of nodes states |
| 3: End if |
| 4: Initialize the pheromone trail using Equation (13) |
| 5: Initialize the placement cost using Equation (9) |
| 6: For nloop from 1 to Max_Loop do |
| 7: Random shuffle input pod queue |
| 8: For ant_k from 1 to Ants_N do |
| 9: For i from 1 to p do |
| 10: Calculate the time value based on (12) |
| 11: Calculate the probability of placement of pod i on each node j using |
| 12: Equation (13) |
| //ant_k chooses node j for pod i according to the highest probability |
| Add the selected node j to the schedule table as a placement of pod i for ant_k
|
| 13: End for |
| 14: Calculate the cost of pod i for ant_k using Equation (10) |
| 15: End for |
| 16: Update the pheromone trail using Equation (15) |
| 17: End for |
| 18: Repeat until the maximum number of iterations is reached or best placement found |