September 2018
Intermediate to advanced
328 pages
10h 46m
English
Cognitive weight is also used to adjust the swarm speed. It is the factor that determines the extent to which the particle will follow its own best solution. 1.49445 is the default value:
![]()
The code is as follows:
// Update Swarm SpeedSwarm[i].Speed[j] = Intertia * Swarm[i].Speed[j] + CognitiveWeight * Swarm_Random() * (Swarm[i].BestPosition[j] - Swarm[i].Position[j])+ SocialWeight * Swarm_Random() * (GlobalBest.BestPosition[j] - Swarm[i].Position[j]);
Cognitive Weight = 1.49445:

Cognitive Weight = 1.19445:
Read now
Unlock full access