资源简介
引入粒子群算法改进的引力搜索算法,带有测试函数,可直接运行测试

代码片段和文件信息
%PSOGSA source code v3.0 Generated by SeyedAli Mirjalili 2011.
%Adopted from: S. Mirjalili S.Z. Mohd Hashim 揂 New Hybrid PSOGSA
%Algorithm for Function Optimization in IEEE International Conference
%on Computer and Information Application?ICCIA 2010) China 2010 pp.374-377.
% This function calculates the value of objective function.
function fit=benchmark_functions(LBenchmark_Function_IDdim)
%You can insert your own objective function with a new Benchmark_Function_ID.
if Benchmark_Function_ID==1
fit=sum(L.^2);
end
if Benchmark_Function_ID==2
fit=sum(abs(L))+prod(abs(L));
end
if Benchmark_Function_ID==3
fit=0;
for i=1:dim
fit=fit+sum(L(1:i))^2;
end
end
if Benchmark_Function_ID==4
fit=max(abs(L));
end
if Benchmark_Function_ID==5
fit=sum(100*(L(2:dim)-(L(1:dim-1).^2)).^2+(L(1:dim-1)-1).^2);
end
if Benchmark_Function_ID==6
fit=sum(abs((L+.5)).^2);
end
if Benchmark_Function_ID==7
fit=sum([1:dim].*(L.^4))+rand;
end
if Benchmark_Function_ID==8
fit=sum(-L.*sin(sqrt(abs(L))));
end
if Benchmark_Function_ID==9
fit=sum(L.^2-10*cos(2*pi.*L))+10*dim;
end
if Benchmark_Function_ID==10
fit=-20*exp(-.2*sqrt(sum(L.^2)/dim))-exp(sum(cos(2*pi.*L))/dim)+20+exp(1);
end
if Benchmark_Function_ID==11
fit=sum(L.^2)/4000-prod(cos(L./sqrt([1:dim])))+1;
end
if Benchmark_Function_ID==12
fit=(pi/dim)*(10*((sin(pi*(1+(L(1)+1)/4)))^2)+sum((((L(1:dim-1)+1)./4).^2).*...
(1+10.*((sin(pi.*(1+(L(2:dim)+1)./4)))).^2))+((L(dim)+1)/4)^2)+sum(Ufun(L101004));
end
if Benchmark_Function_ID==13
fit=.1*((sin(3*pi*L(1)))^2+sum((L(1:dim-1)-1).^2.*(1+(sin(3.*pi.*L(2:dim))).^2))+...
((L(dim)-1)^2)*(1+(sin(2*pi*L(dim)))^2))+sum(Ufun(L51004));
end
if Benchmark_Function_ID==14
aS=[-32 -16 0 16 32 -32 -16 0 16 32 -32 -16 0 16 32 -32 -16 0 16 32 -32 -16 0 16 32;...
-32 -32 -32 -32 -32 -16 -16 -16 -16 -16 0 0 0 0 0 16 16 16 16 16 32 32 32 32 32];
for j=1:25
bS(j)=sum((L‘-aS(:j)).^6);
end
fit=(1/500+sum(1./([1:25]+bS))).^(-1);
end
if Benchmark_Function_ID==15
aK=[.1957 .1947 .1735 .16 .0844 .0627 .0456 .0342 .0323 .0235 .0246];
bK=[.25 .5 1 2 4 6 8 10 12 14 16];bK=1./bK;
fit=sum((aK-((L(1).*(bK.^2+L(2).*bK))./(bK.^2+L(3).*bK+L(4)))).^2);
end
if Benchmark_Function_ID==16
fit=4*(L(1)^2)-2.1*(L(1)^4)+(L(1)^6)/3+L(1)*L(2)-4*(L(2)^2)+4*(L(2)^4);
end
if Benchmark_Function_ID==17
fit=(L(2)-(L(1)^2)*5.1/(4*(pi^2))+5/pi*L(1)-6)^2+10*(1-1/(8*pi))*cos(L(1))+10;
end
if Benchmark_Function_ID==18
fit=(1+(L(1)+L(2)+1)^2*(19-14*L(1)+3*(L(1)^2)-14*L(2)+6*L(1)*L(2)+3*L(2)^2))*...
(30+(2*L(1)-3*L(2))^2*(18-32*L(1)+12*(L(1)^2)+48*L(2)-36*L(1)*L(2)+27*(L(2)^2)));
end
if Benchmark_Function_ID==19
aH=[3 10 30;.1 10 35;3 10 30;.1 10 35];cH=[1 1.2 3 3.2];
pH=[.3689 .117 .2673;.4699 .4387 .747;.1091 .8732 .5547;.03815 .5743 .8828];
fit=0;
for i=1:4
fi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1318 2014-01-23 10:47 license.txt
目录 0 2014-01-24 01:20 PSOGSA_v3\
文件 1339 2012-03-31 12:08 PSOGSA_v3\license.txt
文件 164559 2012-03-31 01:01 PSOGSA_v3\PSOGSA.jpg
文件 4047 2014-01-24 01:19 PSOGSA_v3\benchmark_functions.m
文件 5736 2014-01-24 01:18 PSOGSA_v3\PSOGSA.m
文件 2128 2014-01-24 01:18 PSOGSA_v3\benchmark_functions_details.m
文件 845 2014-01-24 01:19 PSOGSA_v3\Main.m
- 上一篇:mri医学图像蚁群分割
- 下一篇:GSA算法源程序
相关资源
- SVR算法程序可运行
- 计算机图形学 边填充算法实现代码
- 福建师范大学历年算法考卷
- 栈的实现及应用,六种基本算法
- Bresenham算法绘制线段并利用“橡皮筋
- 介绍几种压缩算法及《笨笨数据压缩
- 改进的BP神经网络算法
- A星算法_原理讲解_例子
- 云模型的相关算法cloud
- 旋转矩阵求欧拉角的简单算法
- 栅栏填充算法源码(VC)
- RSA算法源码
- 关联分析Apriori算法实现
- [免费]relax算法成像
- 操作系统 LRU算法 实验报告 及 程序代
- 分治法快速排序算法QuickSort C
- 现代谱估计算法 music ESPRIT 谐波分解
- MUSIC算法c 实现
- 007出纳管理系统 v7[1].5.94 算法注册机
- 克鲁斯卡尔算法C和C 实现代码
- capon波束形成算法-VC实现
- QGA 量子遗传算法
- 利用OpenGL写毛笔字算法
- 带头结点的单链表的c算法实现
- 自适应隐写算法wow
- 协同过滤算法源码
- RSA AES DES ECC加密算法源码
- 密码学课程设计:DES加密解密算法的
- 北航人工智能原理课大作业源代码,
- A*算法的2D演示(带源码)
评论
共有 条评论