localbest.m
来自「许多的PSO优化算法」· M 代码 · 共 21 行
M
21 行
% Script file: localbest.m
%
% Purpose:
% This program to choose the best position of particle.
%
% Record of revisions:
% Date Programmer Description of change
% ==== ========== =====================
% 03/02/09 Z. W. Qiao Original code
%
% Define variables:
% X -- the current position of particle
% Xf -- the current fitness of particle
% Xbf -- the current best fitness of particle
% pBest -- the best position of particle
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if Xbf(ii) > Xf(ii)
pBest(ii,:) = X(ii,:);
Xbf(ii) = Xf(ii);
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?