| Input: Maximum iteration number (maxiter), population size (nP). |
| Output: xbest, fbest. |
| Main algorithm |
| (1) | Initialise a set of population, pL_success, pT_success, pT_fail, pL_fail and . |
| (2) | For i = 1 to maxiter. |
| (2.1) | Identify the best solution, xbest, fbest and define xteacher = xbest. |
| (Teacher Phase) |
| For j = 1 to np |
| (2.2) | Generate pT based on pT_success, j, pT_fail,j. |
| (2.3) | Update the population using (10) based on the xteacher from (14). |
| (2.2.1) | Evaluate the objective function value. |
| (2.2.2) | Perform greedy selection. |
| (2.2.3) | Update pT_success, j, pT_fail,j using (17). |
| End |
| (Learner Phase) |
| For j = 1 to np |
| (2.4) | Generate pL based on pL_success, j, pL_fail,j. |
| (2.5) | Update the population using (18). |
| (2.5.1) | Evaluate the objective function value. |
| (2.5.2) | Perform greedy selection. |
| (2.5.3) | Update pL_success, j, pL_fail,j based on (17). |
| End |
| Update |
| (3) | End |