资源简介
参数自适应 差分 进化算法 遗传算法 matlab
代码片段和文件信息
function [trbjbmn] = SACPMDE(VTRXVminXVmaxDNPfname)
% 参数自适应差分进化算法对Rastrigrin函数起作用
% aa 当前计算到第几次
% VTR 优化的目标值
% fname 选择测试函数
% XVmin 搜索空间下限
% XVmax 搜索空间上限
itermax = 8000; % maximum number of iterations (generations)
F = 0.6; % DE-stepsize F from interval [0 2]
F1=0.45;
CR = 0.9; % crossover probability constant from interval [0 1]
%-----DE Initialize--------------------------------------------------------
pop = zeros(NPD); % initialize pop
for i = 1:NP
pop(i:) = XVmin + rand(1D).*(XVmax - XVmin);
end
popold = zeros(size(pop));% toggle population
val = zeros(1NP); % create and reset the “cost array“
bestmem = zeros(1D); % best population member ever
bestmemit = zeros(1D); % best population member in iteration
for i = 1:NP % Evaluate the best member after initialization
input = pop(i:);
output(i) = feval(fnameinput);
end
val = output‘;
[bestvalitidx] = min(val);
bestmemit = pop(idx:); % best member of current iteration
bestmem = bestmemit; % best member ever
bestval = bestvalit; % best value ever
%-----DE Iteration---------------------------------------------------------
tr = zeros(1itermax);
for j = 1:itermax
if (bestval-VTR) < 1e-5
break
end
popold = pop;
% generate the trail population
for i = 1:NP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CR=0.1;
if val(i)<=mean(val)
CR=0.1+(0.6-0.1)*(val(i)-max(val))/(min(val)-max(val));
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pick up the donor and differential vectors
rd = fix(rand(1) * NP + 1);
while val(rd) > val(i)
rd = fix(rand(1) * NP + 1);
end
rb = fix(rand(1) * NP + 1);
while rb == i || rb == rd
rb = fix(rand(1) * NP + 1);
end
rc = fix(rand(1) * NP + 1);
while rc == i || rc == rd || rc==rb
rc = fix(rand(1) * NP + 1);
end
re = fix(rand(1) * NP + 1);
while re == i || re == rd || re==rb || re==rc
re = fix(rand(1) * NP + 1);
end
% bulid a trial vector and crossover
jr = fix(rand(1) * D + 1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 找基变量
tb=rd;
if val(rb:)<=min(val(rd:)val(rc:))
tb=rb;
end
if val(rc:)<=min(val(rd:)val(rb:))
tb=rc;
end
% 找另两个差分向量;
tm=rd;
if val(rb:)>=min(val(rd:)val(rc:)) && val(rb:)<=max(val(rd:)val(rc:))
tm=rb;
end
if val(rc:)>=min(val(rd:)val(rb:)) && val(rc:)<=max(val(rd:)val(rb:))
tm=rc;
end
% 找最差的向量
tw=rd;
if val(rb:)>=max(val(rd:)val(rc:))
tw=rb;
end
if val(rc:)>=max(val(rd:)val(rb:))
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-09-11 10:16 参数自适应差分进化算法\
文件 55 2018-08-27 11:33 参数自适应差分进化算法\【源码使用必读】.url
文件 4326 2009-05-05 10:13 参数自适应差分进化算法\SACPMDE.m
- 上一篇:Matlab写的教学优化算法!
- 下一篇:基于RSSI定位的matlab仿真程序
相关资源
- 基于RSSI定位的matlab仿真程序
- Matlab写的教学优化算法!
- Matlab GUI 串口调试助手(window32位/64位
- 圆孔夫琅禾费衍射的Matlab实现
- MATLAB——符号矩阵加法
- MATLAB——基于粒子群算法的PID控制器
- matlab烟雾检测
- MATLAB程序
- 基于matlab的最小误差法的胸片分割系
- 基于matlab块匹配的全景图像拼接.zip
- 异步电机矢量控制matlab仿真已调好
- 基于MATLAB的SAE模块
- 基于MATLAB的DBN训练部分
- 手写字母或数字的简单距离对比识别
- 遗传算法完整MATLAB程序实数法,覆盖
- matlab图像处理中英文翻译文献
- PWM整流器matlab仿真
- 香蕉函数-牛顿法优化算法MATLAB代码
- Leader-FollowerMatlabsimulate.rar
- matlab实现两张图片叠加同时透明度改
- 读取nc数据,matlab
- 基于无线TOA和TDOA的无线定位技术
- 时间序列MATLAB代码
- 链路预测matlab版本代码
- 多目标优化算法(四)NSGA3的代码MA
- 简单PQ控制 matlab
- 2fsk调制解调MATLAB仿真代码
- matlab仿真圆孔衍射菲涅尔衍射
- 模糊PID控制m文件代码实现
- MATLAB将视频转化为分帧图片的源代码
评论
共有 条评论