📄 getstgbest.m
字号:
function [o_gBest, o_gBCount]=GetStGBest(i_stPop, i_fitInd)
pSizes=size(i_stPop);
pSize = pSizes(1,1);
o_gBest(1,:)=i_stPop(1,:);%默认排序后适值最高的为全局最优解
o_gBCount = 1;
stPi=2;
gBf=i_stPop(1,i_fitInd);
while (stPi <= pSize ) && (i_stPop(stPi,i_fitInd)==gBf)%只适用于排完序的
o_gBCount = o_gBCount+1;
o_gBest(o_gBCount,:)=i_stPop(stPi,:);
stPi = stPi + 1;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -