【优化算法】平衡粘液模算法 (ESMA)【含Matlab源码 900期】
【摘要】
一、获取代码方式
获取代码方式1: 完整代码已上传我的资源:【优化算法】平衡粘液模算法 (ESMA)【含Matlab源码 900期】
获取代码方式2: 通过订阅紫极神光博客付费专栏,凭支付凭证,私信博...
一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【优化算法】平衡粘液模算法 (ESMA)【含Matlab源码 900期】
获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。
备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);
二、部分源代码
clearvars
close all
clc
disp('The ESMA is tracking the problem');
N=20; % 粘菌数
Function_name='F23' % 测试功能的名称,可以从 F1 到 F23
MaxIT=200; % 最大迭代次数
[lb,ub,dim,fobj]=Get_Functions_details(Function_name); % Function details
Times=11; %您想要运行 ESMA 的独立次数
display(['Number of independent runs: ', num2str(Times)]);
for i=1:Times
[Destination_fitness(i),bestPositions(i,:),Convergence_curve(i,:)]=ESMA(N,MaxIT,lb,ub,dim,fobj);
display(['The optimal fitness of ESMA is: ', num2str(Destination_fitness(i))]);
end
[bestfitness,index]=min(Destination_fitness);
disp('--------Best Fitness, Average Fitness, Standard Deviation and Best Solution--------');
display(['The best fitness of ESMA is: ', num2str(bestfitness)]);
display(['The average fitness of ESMA is: ', num2str(mean(Destination_fitness))]);
display(['The standard deviation fitness of ESMA is: ', num2str(std(Destination_fitness))]);
display(['The best location of ESMA is: ', num2str(bestPositions(index,:))]);
semilogy(Convergence_curve(index,:),'LineWidth',1);
xlabel('迭代');
ylabel('最优值');
legend('ESMA');
box on;
axis tight;
grid off;
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
三、运行结果
四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 包子阳,余继周,杨杉.智能优化算法及其MATLAB实例(第2版)[M].电子工业出版社,2016.
[2]张岩,吴水根.MATLAB优化算法源代码[M].清华大学出版社,2017.
文章来源: qq912100926.blog.csdn.net,作者:海神之光,版权归原作者所有,如需转载,请联系作者。
原文链接:qq912100926.blog.csdn.net/article/details/123953526
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)