|
Algorithm 2: Level-based learning and knowledge transfer |
Input: the source task particle swarm Ps, the target task particle swarm Pt, number of levels L, random mating probability rmp, level size LS, control parameter ϕ. /* Initialization */
OP = {}
For i = {L, …, 2} do
For j = {1, …, LS} do
xnew = xi,j;
vnew = vi,j;
If i ! = 1 then
Select two level from top (i−1) levels: l1, l2;
Else
l1 = l2 = 1;
End If
If l1 > l2 then
Swap (l1, l2);
End If
If rand < rmp then
Else
End If
Update vnew and xnew according to Equations (3) and (4);
particlenew = {vnew, xnew,};
OP = OP ∪ particlenew;
|
| Output: OP
|