【优化算法】寄生-捕食优化算法(PPA)【含Matlab源码 1445期】
【摘要】
一、获取代码方式
获取代码方式1: 通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。
获取代码方式2: 完整代码已上传我的资源:【优化算法】寄生-捕食优化算法(PPA)【含Matla...
一、获取代码方式
获取代码方式1:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。
获取代码方式2:
完整代码已上传我的资源:【优化算法】寄生-捕食优化算法(PPA)【含Matlab源码 1445期】
备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);
二、部分源代码
%______________________________________________________________________________________________
% Parasitism ?Predation algorithm (PPA):
% mimics the interaction between predators/cats, parasites/cuckoos
% and hosts/crows in the crow朿uckoo朿at system model
% Developed in MATLAB R2017a
%
%
%
% For more info please refer to:
% Mohamed A. A. A., Hassan S. A., Hemeida A. M., et al.(2019).
% Parasitism朠redation algorithm (PPA): A novel approach for feature selection.
% Ain Shams Engineering Journal. DOI: 10.1016/j.asej.2019.10.004
%_______________________________________________________________________________________________
% The initial parameters that you need are:
% d = number of your variables
% MAX_ITER = maximum number of generations
% n = number of search agents
% lb is the lower bound: lb=[lb_1,lb_2,...,lb_d]
% up is the uppper bound: ub=[ub_1,ub_2,...,ub_d]
clear all
for iji=14:23
if iji==1;F=('F1');elseif iji==2;F=('F2');elseif iji==3;F=('F3');elseif iji==4;F=('F4');elseif iji==5;F=('F5'); ...
elseif iji==6;F=('F6');elseif iji==7; F=('F7'); elseif iji==8; F=('F8');elseif iji==9; F=('F9'); ...
elseif iji==10; F=('F10');elseif iji==11; F=('F11');elseif iji==12; F=('F12'); ...
elseif iji==13; F=('F13');elseif iji==14; F=('F14');elseif iji==15; F=('F15');
elseif iji==16; F=('F16');elseif iji==17; F=('F17');elseif iji==18; F=('F18');
elseif iji==19; F=('F19');elseif iji==20; F=('F20');elseif iji==21; F=('F21');
elseif iji==22; F=('F22');elseif iji==23; F=('F23');
end
if iji < 14;MAX_ITER=1000;else; MAX_ITER=500;end% Maximum number of iterations
n =30; % Number of search agents
% Load details of the selected benchmark function
[lb,ub,d,fobj] = Get_Functions_details(F);
[Best_pos,Best_score,Convergence_curve]=PPA(n,MAX_ITER,ub,lb,d,fobj);
%Draw and display objective function
%figure,semilogy(Convergence_curve); title( F ); xlabel('Iteration'); ylabel('Best score obtained so far');
% display(['The optimal solution of ',F, ' is: ',num2str(Best_pos)]);
display(['The optimal value of ',F,' is : ', num2str(Best_score)]);
end
%______________________________________________________________________________________________
% Parasitism朠redation Algorithm (PPA)
% reference:
% [1] X. Yao, Y. Liu, G. Lin, Evolutionary programming made faster, IEEE Trans.Evolution. Comput. 3 (2) (1999) 82?02.
% [2] Salimi H. Stochastic Fractal Search: A powerful metaheuristic algorithm. Knowledge Based Syst 2015; 75: 1-18.?doi:10.1016/j.knosys.2014.07.025
% lb is the lower bound: lb=[lb_1,lb_2,...,lb_d]
% up is the uppper bound: ub=[ub_1,ub_2,...,ub_d]
% dim is the number of variables (dimension of the problem)
%_______________________________________________________________________________________________
function [lb,ub,dim,fobj] = Get_Functions_details(F)
switch F
case 'F1'
fobj = @F1;
lb=-100;
ub=100;
dim=30;
case 'F2'
fobj = @F2;
lb=-10;
ub=10;
dim=30;
case 'F3'
fobj = @F3;
lb=-100;
ub=100;
dim=30;
case 'F4'
fobj = @F4;
lb=-100;
ub=100;
dim=30;
case 'F5'
fobj = @F5;
lb=-30;
ub=30;
dim=30;
case 'F6'
fobj = @F6;
lb=-100;
ub=100;
dim=30;
case 'F7'
fobj = @F7;
lb=-1.28;
ub=1.28;
dim=30;
case 'F8'
fobj = @F8;
lb=-500;
ub=500;
dim=30;
case 'F9'
fobj = @F9;
lb=-5.12;
ub=5.12;
dim=30;
case 'F10'
fobj = @F10;
lb=-32;
ub=32;
dim=30;
case 'F11'
fobj = @F11;
lb=-600;
ub=600;
dim=30;
case 'F12'
fobj = @F12;
lb=-50;
ub=50;
dim=30;
case 'F13'
fobj = @F13;
lb=-50;
ub=50;
dim=30;
case 'F14'
fobj = @F14;
lb=-65.536;
ub=65.536;
dim=2;
case 'F15'
fobj = @F15;
lb=-5;
ub=5;
dim=4;
case 'F16'
fobj = @F16;
lb=-5;
ub=5;
dim=2;
case 'F17'
fobj = @F17;
lb=[-5,0];
ub=[10,15];
dim=2;
case 'F18'
fobj = @F18;
lb=-5;
ub=5;
dim=2;
- 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
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
三、运行结果
四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 包子阳,余继周,杨杉.智能优化算法及其MATLAB实例(第2版)[M].电子工业出版社,2016.
[2]张岩,吴水根.MATLAB优化算法源代码[M].清华大学出版社,2017.
文章来源: qq912100926.blog.csdn.net,作者:海神之光,版权归原作者所有,如需转载,请联系作者。
原文链接:qq912100926.blog.csdn.net/article/details/120934628
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)