% Subtraction-Average-Based Optimizer
%%% Designed and Developed by Pavel Trojovsk? and Mohammad Dehghani %%%
function[Best_score,Best_pos,SABO_curve]=SABO(N,T,lo,hi,m,fitness)
lo=ones(1,m).*(lo); % Lower limit for variables
hi=ones(1,m).*(hi); % Upper limit for variables
%% INITIALIZATION
for i=1:m
X(:,i) = lo(i)+rand(N,1).*(hi(i) - lo(i)); % Initial population
end
for i =1:N
L=X(i,:);
fit(i)=fitness(L);
end
%%
for t=1:T % algorithm iteration
%% update: BEST proposed solution
[Fbest , blocation]=min(fit);
if t==1
xbest=X(blocation,:); % Optimal location
fbest=Fbest; % The optimization objective function
elseif Fbest<fbest
fbest=Fbest;
xbest=X(blocation,:);
end
%%
DX=zeros(N,m);
for i=1:N
%% based om Eq(4)
for j=1:N
I=round(1+rand+rand);
for d=1:m
DX(i,d)=DX(i,d)+(X(j,d)-I.*X(i,d)).*sign(fit(i)-fit(j));
end
end
X_new_P1=X(i,:)+((rand(1,m).*DX(i,:))./(N));
X_new_P1 = max(X_new_P1,lo);X_new_P1 = min(X_new_P1,hi);
%% update position based on Eq (5)
L=X_new_P1;
fit_new_P1=fitness(L);
if fit_new_P1<fit(i)
X(i,:) = X_new_P1;
fit(i) = fit_new_P1;
end
%%
end% end for i=1:N
%%
best_so_far(t)=fbest;
average(t) = mean (fit);
end
Best_score=fbest;
Best_pos=xbest;
SABO_curve=best_so_far;
end
减法平均优化器.zip
需积分: 5 97 浏览量
2023-08-11
16:41:17
上传
评论
收藏 2KB ZIP 举报
![avatar](https://profile-avatar.csdnimg.cn/1e529c6af006432cb55c280e71efde36_weixin_63199521.jpg!1)
昨日与你1
- 粉丝: 253
- 资源: 220
最新资源
- 建筑结构\施工图\A型施工图-建筑-空施08.dwg
- 建筑结构\施工图\A型施工图-建筑-空施07.dwg
- 视频下载神器-**猫抓**浏览器插件
- Java课程设计模板.docx
- com.whidev.mapchart.apk
- Delphi 12 控件之R121.patch1.zip
- Delphi 12 控件RADStudio-12-1-29-0-51961-7529-KeyPatch.rar
- Delphi 12 控件之Delphi 10.4.2 patch合并包.rar
- Delphi 12 控件之12.1Patch-Patch1.rar
- Delphi 12 控件之LMD.VCL.Full.Version.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)