Menu

#2 There is a problem with Chi

open
nobody
None
5
2005-06-12
2005-06-12
Anonymous
No

The toolbox has an error in the actualization of the
velocities

% Calculate Velocity
if ~psoOptions.Flags.Neighbor %Normal
VStep = w_now*VStep +
psoOptions.SParams.c1*R1.*(PBest-Swarm) +
psoOptions.SParams.c2*R2.*(A-Swarm);
else %With neighborhood
R3 = rand(SwarmSize, psoOptions.Vars.Dim);
%random nos for neighborhood
VStep = w_now*VStep +
psoOptions.SParams.c1*R1.*(PBest-Swarm) +
psoOptionsSParams.c2*R2.*(A-Swarm) +
psoOptionsSParams.c3*R3.*(B-Swarm);
end

%Adding Chi Actualization (Correction)

VStep = psoOptions.SParams.Chi * VStep

% Apply Vmax Operator for v > Vmax
changeRows = VStep > psoOptions.SParams.Vmax;
VStep(find(changeRows)) = psoOptions.SParams.Vmax;
% Apply Vmax Operator for v < -Vmax
changeRows = VStep < -psoOptions.SParams.Vmax;
VStep(find(changeRows)) = -psoOptions.SParams.Vmax;

% ::UPDATE POSITIONS OF PARTICLES:: (Corrected)
Swarm = Swarm + VStep; % Evaluate new Swarm

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.