%__________________________________________________________________ %
% %
% Dynamic Arithmetic Optimization Algorithm (DAOA) %
% %
%% Function Details
% function [Best_FF,Best_P,Conv_curve]=DAOA(N,M_Iter,LB ,UB,Dim,ObjFuncName)
display('AOA Working');
Dim=2; % Number of Variable
LB = (0)*ones(1,Dim); % Upper Bound
UB = (1)*ones(1,Dim); % Lower Bound
F_obj= @F1; %Name of the Function
N=5; %Number of Colors (Npop)
M_Iter=500;
Best_P=zeros(1,Dim);
Best_FF=inf;
Conv_curve=zeros(1,M_Iter);
%% Initialize the positions of solution
X=initialization(N,Dim,UB,LB);
Xnew=X;
Ffun=zeros(1,size(X,1)); % (fitness values)
Ffun_new=zeros(1,size(Xnew,1)); % (fitness values)
C_Iter=1;
Mu=0.001;
alpha=25;
for i=1:size(X,1)
Ffun(1,i)=F_obj(X(i,:)); %Calculate the fitness values of solutions
if Ffun(1,i)<Best_FF
Best_FF=Ffun(1,i);
Best_P=X(i,:);
end
end
%% Main Loop
while C_Iter<M_Iter+1 % Main loop
%DAF=((C_Iter/M_Iter+1)^((-1)*alpha)); %DAF1
DAF=(M_Iter+1/C_Iter)^((alpha)); %DAF2
DCS=.99*((1-(C_Iter/M_Iter)^(0.5))); % DCS
%Upate the Position of solutions
for i=1:size(X,1) % if each of the UB and LB has a just value
for j=1:size(X,2)
r1=rand();
if (size(LB,2)==1)
if r1<DAF
r2=rand();
if r2>0.5
Xnew(i,j)=(Best_P(1,j)/(DCS+eps)*((UB-LB)*Mu+LB));
else
Xnew(i,j)=(Best_P(1,j)*DCS*((UB-LB)*Mu+LB));
end
else
r3=rand();
if r3>0.5
Xnew(i,j)=(Best_P(1,j)-DCS*((UB-LB)*Mu+LB));
else
Xnew(i,j)=(Best_P(1,j)+DCS*((UB-LB)*Mu+LB));
end
end
end
if (size(LB,2)~=1) % if each of the UB and LB has more than one value
r1=rand();
if r1<DAF
r2=rand();
if r2>0.5
Xnew(i,j)=((Best_P(1,j)/(DCS+eps)*((UB(j)-LB(j))*Mu+LB(j))));
else
Xnew(i,j)=((Best_P(1,j)*DCS*((UB(j)-LB(j))*Mu+LB(j))));
end
else
r3=rand();
if r3>0.5
Xnew(i,j)=((Best_P(1,j)-DCS*((UB(j)-LB(j))*Mu+LB(j))));
else
Xnew(i,j)=((Best_P(1,j)+DCS*((UB(j)-LB(j))*Mu+LB(j))));
end
end
end
end
Flag_UB=Xnew(i,:)>UB; % check if they exceed (up) the boundaries
Flag_LB=Xnew(i,:)<LB; % check if they exceed (down) the boundaries
Xnew(i,:)=(Xnew(i,:).*(~(Flag_UB+Flag_LB)))+UB.*Flag_UB+LB.*Flag_LB;
Ffun_new(1,i)=F_obj(Xnew(i,:)); % calculate Fitness function
if Ffun_new(1,i)<Ffun(1,i)
X(i,:)=Xnew(i,:);
Ffun(1,i)=Ffun_new(1,i);
end
if Ffun(1,i)<Best_FF
Best_FF=Ffun(1,i);
Best_P=X(i,:);
end
end
%Update the convergence curve
figure
Conv_curve(C_Iter)=Best_FF;
plot(Conv_curve,'Color','r','LineWidth',2)
title('Convergence curve')
xlabel('Iteration');
ylabel('Best fitness function');
axis tight
legend('DAOA')
%Print the best solution details after every 50 iterations
% if mod(C_Iter,50)==0
display(['At iteration ', num2str(C_Iter), ' the best solution fitness is ', num2str(Best_FF)]);
% end
C_Iter=C_Iter+1; % incremental iteration
end
没有合适的资源?快使用搜索试试~ 我知道了~
动态算术优化算法 (DAOA)附matlab代码
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共4个文件
m:3个
png:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 22 浏览量
2022-10-16
10:19:01
上传
评论
收藏 17KB ZIP 举报
温馨提示
1.版本:matlab2019a,不会运行可私信 2.领域:【智能优化算法】 3.内容:基于动态算术优化算法求解单目标问题 (DAOA) Dynamic Arithmetic Optimization Algorithm (DAOA).zip 4.适合人群:本科,硕士等教研学习使用
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.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)
![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)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.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/PNG.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)
共 4 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/0952dabfe4084a058a29f6b3884c6064_qq_59747472.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7249
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的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)
最新资源
- Django(正反向练习)
- 实践项目-图书馆管理系统(C#.NET)
- 10Eclipse项目源码.jpg
- 大屏可视化数据课程项目
- Maven 快速入门指南:安装和配置方法详解
- STM32物信息通过MQTT协议上传云平台
- STM32物信息通过MQTT协议上传云平台
- 基于Selenium的Java爬虫实战(内含谷歌浏览器Chrom和Chromedriver版本122.0.6260.0)
- 基于Selenium的Java爬虫实战(内含谷歌浏览器Chrom和Chromedriver版本122.0.6259.0)
- 基于Selenium的Java爬虫实战(内含谷歌浏览器Chrom和Chromedriver版本122.0.6258.0)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![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)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)