function [Best_vulture1_F,Best_vulture1_X,convergence_curve]=AVOA(pop_size,max_iter,lower_bound,upper_bound,variables_no,fobj)
% initialize Best_vulture1, Best_vulture2
Best_vulture1_X=zeros(1,variables_no);
Best_vulture1_F=inf;
Best_vulture2_X=zeros(1,variables_no);
Best_vulture2_F=inf;
%Initialize the first random population of vultures
X=initialization(pop_size,variables_no,upper_bound,lower_bound);
%% Controlling parameter
p1=0.6;
p2=0.4;
p3=0.6;
alpha=0.8;
betha=0.2;
gamma=2.5;
%%Main loop
current_iter=0; % Loop counter
while current_iter < max_iter
for i=1:size(X,1)
% Calculate the fitness of the population
current_vulture_X = X(i,:);
current_vulture_F=fobj(current_vulture_X);
% Update the first best two vultures if needed
if current_vulture_F<Best_vulture1_F
Best_vulture1_F=current_vulture_F; % Update the first best bulture
Best_vulture1_X=current_vulture_X;
end
if current_vulture_F>Best_vulture1_F && current_vulture_F<Best_vulture2_F
Best_vulture2_F=current_vulture_F; % Update the second best bulture
Best_vulture2_X=current_vulture_X;
end
end
a=unifrnd(-2,2,1,1)*((sin((pi/2)*(current_iter/max_iter))^gamma)+cos((pi/2)*(current_iter/max_iter))-1);
P1=(2*rand+1)*(1-(current_iter/max_iter))+a;
% Update the location
for i=1:size(X,1)
current_vulture_X = X(i,:); % pick the current vulture back to the population
F=P1*(2*rand()-1);
random_vulture_X=random_select(Best_vulture1_X,Best_vulture2_X,alpha,betha);
if abs(F) >= 1 % Exploration:
current_vulture_X = exploration(current_vulture_X, random_vulture_X, F, p1, upper_bound, lower_bound);
elseif abs(F) < 1 % Exploitation:
current_vulture_X = exploitation(current_vulture_X, Best_vulture1_X, Best_vulture2_X, random_vulture_X, F, p2, p3, variables_no, upper_bound, lower_bound);
end
X(i,:) = current_vulture_X; % place the current vulture back into the population
end
current_iter=current_iter+1;
convergence_curve(current_iter)=Best_vulture1_F;
X = boundaryCheck(X, lower_bound, upper_bound);
fprintf('In Iteration %d, best estimation of the global optimum is %4.4f \n ', current_iter,Best_vulture1_F );
end
end
没有合适的资源?快使用搜索试试~ 我知道了~
非洲秃鹫优化算法(AVOA)【含Matlab源码 1805期】.zip
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共11个文件
m:10个
jpg:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
需积分: 0 3 下载量 83 浏览量
2023-12-29
12:29:52
上传
评论
收藏 27KB ZIP 举报
温馨提示
CSDN海神之光上传的代码均可运行,亲测可用,直接替换数据即可,适合小白; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主或扫描博客文章底部QQ名片; 4.1 博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 11 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/0eaa1f4af7e64f538f743d83cddaf316_keepingmatlab.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
Matlab武动乾坤
- 粉丝: 1w+
- 资源: 49
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)