| Function Migration_Par_MMPSO: Extracting tests using Migration Parallel MMPSO |
| For each available thread t do |
| Generate the initial population with random questions; |
| While stop conditions are not met do |
| Gather Gbest and all Pbest; |
| Foreach Pbest |
| Move Pbest towards Gbest using location information of Gbest,; |
| Update velocity using equation (4); |
| Update position using equation (5); |
| End for |
| Gbest moves in a random direction to search for the optimal solution; |
| If the probability for migration γ is met then |
| Execute function Migration_MMPSO with t; |
| End if |
| End while |
| End for |
| Function Migration _MMPSO: Improving solutions with migration method |
| Lock the current thread (i.e., block all modifications from other threads to the current thread) to avoid interference from other threads to the current thread during migration procedure. |
| Select λ, which are the set of stronger individuals for migration except for the Gbest; |
| Lock other threads so that no unintended changes will happen to them during the migration: |
| Choose a thread that has a Gbest weaker than the one in the current thread; |
| Unlock the other threads except for chosen thread; |
| Set the status of the chosen thread to “Exchanging”; |
| Move the λ selected individuals to the chosen thread; |
| Remove those λ selected individuals; |
| Select the λ weakest individuals in the chosen thread; |
| Add those λ weakest individuals to the current thread; |
| Set the status of chosen thread to “Available”; |
| Unlock the current thread and the chosen thread; |