资源简介
绝对原创,本程序是用人工鱼群求解240个变量的优化问题,较复杂
代码片段和文件信息
clear all; close all; tic;
winti = 0.9 ; wfina = 0.4; c1fi = 1.25 ; c1in = 2.75; c2fi = 2.5 ; c2in = 0.5;
no = 100; aeint = 1; aefin = 0.1; bei = 1; shiduanshu = 24; yjd = 1.2; trynumber = 20;
bili1 = .8; zuiyoubili = .1; liyu1 = 1; liyuss = .2; liyu3 = .2; step = 0.8; qianjinbili = 0.2;
tmax = 700; cunzui = zeros(1no); zqun = 100; rongoren = 1000; rongren = 1000; rongrenv = 10; suduxiao = .1;
pmin = [150 135 73 60 73 57 20 47 20 55]; pomin = repmat(pmin[shiduanshu1]); jizushu = length(pmin);
pmax = [470 460 340 300 600 570 700 425 660 610]; pomax = repmat(pmax[shiduanshu1]); cundav = inf*ones(zqunrongrenv); cunxiaov = inf*ones(zqunrongrenv);
poimax = reshape(pomax1shiduanshu*length(pmin)) ; poimin = reshape(pomin1shiduanshu*length(pmin)) ; changdu = length(poimin);
yigezuiyoufy = inf*ones(rongren5); yigezuioyoufy = inf*ones(rongoren5); v = zeros(zqunchangdu);
yigezuiyouxju = cell(rongren 1);
for i = 1:zqun
x(i:) = poimin + (poimax - poimin).*rand(1changdu);
end
[F yy yju meihao wuran dianjiax] = fo(x); [ypaixu yapaiweizhi] = sort(yju);
x(yapaiweizhi(round(zqun*bili1):zqun):) = [];F(yapaiweizhi(round(zqun*bili1):zqun)) = []; yy(yapaiweizhi(round(zqun*bili1):zqun)) = [];
meihao(yapaiweizhi(round(zqun*bili1):zqun)) = []; wuran(yapaiweizhi(round(zqun*bili1):zqun)) = []; dianjiax(yapaiweizhi(round(zqun*bili1):zqun)) = [];
[Fpaixu Fpaweizhi] = min(F); zuiyounumber = round(length(F)*zuiyoubili); bazuioyoux =zeros(zuiyounumberchangdu);
% yigezuiyoux(1:) = x(Fpaweizhi(1):);
% yigezuioyoux(1:) = x(Fpaweizhi(1):);
yigezuiyoufy(1:) = [Fpaixu(1) yy(Fpaweizhi(1)) meihao(Fpaweizhi(1)) wuran(Fpaweizhi(1)) dianjiax(Fpaweizhi(1))] ; Fbest = Fpaixu(1);
yigezuioyoufy(1:) = [Fpaixu(1) yy(Fpaweizhi(1)) meihao(Fpaweizhi(1)) wuran(Fpaweizhi(1)) dianjiax(Fpaweizhi(1))];
for i = length(F)+1:zqun
x(i:) = poimin + (poimax - poimin).*rand(1changdu);
end
figure
tt = 0; t = 0; tto = 0; t1 = 0; t2 = 0; t3 = 0; t4 = 0; ttzui = 0;
while t<1000
t = t + 1; tmax = tmax + 1;
% c1 = 2; c2 = 2; w = winti - (winti - wfina)*(t/tmax);
for i = 1:zqun
xi = x(i:); fxi = f(xi);
y = liyujisuan(xxiliyu1);
liyuxi = x(y:);
%第一种行为,追尾行为
suizhong = f(liyuxi);
[suijibest suijiweizhi] = min(suizhong);
pbest = liyuxi(suijiweizhi:) ;
ypbest = liyujisuan(xpbestliyu3);
nf = length(ypbest);
if fxi/yjd > suijibest*nf
v(i:) = (pbest - xi)*qianjinbili*rand;
t1 = t1 + 1;
% /sqrt(sum((pbest - xi).*(pbest - xi))))*step*rand;
else
%第二种行为,聚群行为
xzhong = sum(liyuxi)/length(y);
suizhong = f(xzhong);
ypbest = liyujisuan(xxzhongliyu3);
nf = length(ypbest);
if fxi/yjd > suizhong*nf
v(i:) = (xzhong - xi)*qianjinbili*rand;
t2 = t2 + 1;
% /sqr
- 上一篇:MATLAB下料问题原创程序
- 下一篇:psnr_mse的matlab代码实现
相关资源
- psnr_mse的matlab代码实现
- MATLAB下料问题原创程序
- matlab图片批量预处理并保存为mat数据
- 地震滤波1.m
- 多层水平介质.m
- 基于天牛须搜索算法优化BP神经网络
- BUCK电路基于matlabpwm 闭环反馈
- 反激变换器基于matlab
- matlab实现中值滤波去除脉冲噪声
- 机器学习-线性回归matlab代码已检验正
- Matlab实现Hu不变矩特征
- retinex的matlab程序
- matlab 提取图像的静止背景 以及从视频
- matlab实现最大熵法图像分割程序源代
- matlab 非锐化掩蔽、高提升滤波
- matlab r2008b
- matlab 实现2psk的调制解调
- 基于matlab的语音合成源程序
- matlab_2011b_
- IEEE_14_BUS
- 电磁场实验matlab仿真
- Matlab 分类器
- NSGA-II 中文版注释
- NSGA-II 带中文版注释
- DEA的Matlab程序272543
- fdtd实现代码
- MMC的7电平柔性直流输电模型用matlab编
- 数字图像处理基于MATLAB膨胀算法实现
- MATLAB 基于小波变换图像压缩方法的代
- FSIM—特征相似度MATLAB代码
评论
共有 条评论