egi-megi / porr-pso

2 stars 0 forks source link

vector<Particle> GbestVector lapping elements #9

Closed mpiku closed 3 years ago

mpiku commented 3 years ago

Function void computeGbest(Particle *particle); does not guarantee uniques of elements in the vector.

https://github.com/egi-megi/rojCzastek_Szczepanski_Jurkiewicz_Pikulinski/blob/465bd785737515fe13b82864bb7a104bbded701a/src/Swarm.cpp#L81-L93

mpiku commented 3 years ago

Attention! std::vector<Particle> GbestVector is depracted now.

New way of storing two best solutions is via public member of Swarm std::pair<Particle, Particle> globalBestParticle.