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

资源存储库
- 粉丝: 1w+
- 资源: 395
最新资源
- 软件开发文档:统一服务架构平台需求规格说明书.docx
- 软件开发文档:投资分析平台2018年上半年需求规格说明书.docx
- 软件开发文档:腾讯公司产品需求文档模板.docx
- 软件开发文档:腾讯产品需求文档.docx
- 软件开发文档:腾讯QQ浏览器需求文档详细模板.docx
- 软件开发文档:体系结构设计说明书--.docx
- 软件开发文档:太平需求规格说明书20190110.docx
- 软件开发文档:淘宝PRD标准需求说明书.docx
- 软件开发文档:搜索引擎系统需求分析说明书.docx
- FontCreator14.0.0.2883.exe
- 软件开发文档:税务系统内部控制监督平台_内控系统_需求规格说明书.docx
- 软件开发文档:双创背景下面向企业的知识产权移动学习平台-培训端_需求规格说明书V2.8.pdf
- 软件开发文档:数据库-文档.docx
- 软件开发文档:数据库说明文档.docx
- 软件开发文档:数据库详细设计说明书.docx
- 软件开发文档:数据库设计及使用规范.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


