% bald eagle search optimisation algorithm -BES
function [bestf,bestx, Convergence_curve]=BES(nPop,MaxIt,low,high,dim,fobj)
%nPop: size of population
%MaxIt:number of iterations
%low, high : space of Decision variables
%dim : number of Decision variables
%fobj : funcation
% paper citation : Alsattar, H. A., Zaidan, A. A., & Zaidan, B. B. (2020). Novel meta-heuristic bald eagle search optimisation algorithm. Artificial Intelligence Review, 53(3), 2237-2264.?
st=cputime;
% Initialize Best Solution
BestSol.cost = inf;
for i=1:nPop
pop.pos(i,:) = low+(high-low).*rand(1,dim);
pop.cost(i)=fobj(pop.pos(i,:));
if pop.cost(i) < BestSol.cost
BestSol.pos = pop.pos(i,:);
BestSol.cost = pop.cost(i);
end
end
for t=1:MaxIt
%% 1- select_space
[pop, BestSol ,s1(t)]=select_space(fobj,pop,nPop,BestSol,low,high,dim);
%% 2- search in space
[pop, BestSol, s2(t)]=search_space(fobj,pop,BestSol,nPop,low,high);
%% 3- swoop
[pop, BestSol ,s3(t)]=swoop(fobj,pop,BestSol,nPop,low,high);
Convergence_curve(t)=BestSol.cost;
bestf= BestSol.cost;
bestx=BestSol.pos;
end
function [pop, BestSol, s1]=select_space(fobj,pop,npop,BestSol,low,high,dim)
Mean=mean(pop.pos);
% Empty Structure for Individuals
empty_individual.pos = [];
empty_individual.cost = [];
lm= 2;
s1=0;
for i=1:npop
newsol=empty_individual;
newsol.pos= BestSol.pos+ lm*rand(1,dim).*(Mean - pop.pos(i,:));
newsol.pos = max(newsol.pos, low);
newsol.pos = min(newsol.pos, high);
newsol.cost=fobj(newsol.pos);
if newsol.cost<pop.cost(i)
pop.pos(i,:) = newsol.pos;
pop.cost(i)= newsol.cost;
s1=s1+1;
if pop.cost(i) < BestSol.cost
BestSol.pos= pop.pos(i,:);
BestSol.cost=pop.cost(i);
end
end
end
function [pop best s1]=search_space(fobj,pop,best,npop,low,high)
Mean=mean(pop.pos);
a=10;
R=1.5;
% Empty Structure for Individuals
empty_individual.pos = [];
empty_individual.cost = [];
s1=0;
for i=1:npop-1
A=randperm(npop);
pop.pos=pop.pos(A,:);
pop.cost=pop.cost(A);
[x y]=polr(a,R,npop);
newsol=empty_individual;
Step = pop.pos(i,:) - pop.pos(i+1,:);
Step1=pop.pos(i,:)-Mean;
newsol.pos = pop.pos(i,:) +y(i)*Step+x(i)*Step1;
newsol.pos = max(newsol.pos, low);
newsol.pos = min(newsol.pos, high);
newsol.cost=fobj(newsol.pos);
if newsol.cost<pop.cost(i)
pop.pos(i,:) = newsol.pos;
pop.cost(i)= newsol.cost;
s1=s1+1;
if pop.cost(i) < best.cost
best.pos= pop.pos(i,:);
best.cost=pop.cost(i);
end
end
end
function [pop ,best ,s1]=swoop(fobj,pop,best,npop,low,high)
Mean=mean(pop.pos);
a=10;
R=1.5;
% Empty Structure for Individuals
empty_individual.pos = [];
empty_individual.cost = [];
s1=0;
for i=1:npop
A=randperm(npop);
pop.pos=pop.pos(A,:);
pop.cost=pop.cost(A);
[x y]=swoo_p(a,R,npop);
newsol=empty_individual;
Step = pop.pos(i,:) - 2*Mean;
Step1= pop.pos(i,:)-2*best.pos;
newsol.pos = rand(1,length(Mean)).*best.pos+x(i)*Step+y(i)*Step1;
newsol.pos = max(newsol.pos, low);
newsol.pos = min(newsol.pos, high);
newsol.cost=fobj(newsol.pos);
if newsol.cost<pop.cost(i)
pop.pos(i,:) = newsol.pos;
pop.cost(i)= newsol.cost;
s1=s1+1;
if pop.cost(i) < best.cost
best.pos= pop.pos(i,:);
best.cost=pop.cost(i);
end
end
end
function [xR, yR]=swoo_p(a,R,N)
th = a*pi*exp(rand(N,1));
r =th; %R*rand(N,1);
xR = r.*sinh(th);
yR = r.*cosh(th);
xR=xR/max(abs(xR));
yR=yR/max(abs(yR));
function [xR, yR]=polr(a,R,N)
%// Set parameters
th = a*pi*rand(N,1);
r =th+R*rand(N,1);
xR = r.*sin(th);
yR = r.*cos(th);
xR=xR/max(abs(xR));
yR=yR/max(abs(yR));
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
1.版本:matlab2014/2019a,内含运行结果,不会运行可私信 2.领域:智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,更多内容可点击博主头像 3.内容:标题所示,对于介绍可点击主页搜索博客 4.适合人群:本科,硕士等教研学习使用 5.博客介绍:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可si信
资源推荐
资源详情
资源评论
收起资源包目录
【BP分类】基于秃鹰搜索算法优化BP神经网络BES-BP数据分类预测附Matlab代码.zip (10个子文件)
运行结果1.jpg 35KB
运行结果5.jpg 34KB
initialization.m 2KB
BES.m 4KB
main.m 4KB
数据集.xlsx 73KB
运行结果2.jpg 40KB
运行结果4.jpg 32KB
fun.m 994B
运行结果3.jpg 28KB
共 10 条
- 1
天天Matlab科研工作室
- 粉丝: 4w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页