سلام دوستان اگه کسی آموزش pso در متلب چیزی داره به اشتراک بگذاره.
این حالت کلی کد الگوریتم برای قسمت gbest هستش
الگوریتمpso بر اساس بهترین تجربه گروهی ذرات
gbest PSO algoritm
Creat and initialize an D-dimensional swarm, S;
Repeat
For each particle i=1,…,S.n[SUB]s[/SUB] do
//set the personal best position
If then
End
//set the personal best position
If then
End
End
For each particle i=1,…,S.n[SUB]s[/SUB] do
update the velocity using formoula (2)
update the position using formoula (1)
End
Until stopping condition is true
بعد از اعمال gbest که با توجه به نوع همسایگی ها به نحوه های متعدد پیاده سازی میشه باید ibest رو شبیه سازی کنید