1 简介
静 电 放 电 算 法 ( Electrostatic Discharge Algorithm,ESDA) 是 Houssem[15]于 2019 年受静电放电事件启发提出的一种新型元启发式优化算法。ESDA 假设电子设备适应度与搜索空间位置有关,利用电子设备个体间直接或间接静电放电现象,通过具有最低适应度值电子设备向高适应度值电子设备移动来改变其位置以获得最佳空间位置,即问题最优解[15]。与传统群智能算法相比,ESDA 设置参数少、收敛速度快、寻优精度高,是一种具有较好竞争力的群体智能算法。
2 部分代码
clear all
clc
close all
d=5; % dimension
options.lb=-32*ones(1,d); % lower bound
options.ub=32*ones(1,d); % upper bound
options.ProblemSize=length(options.ub); % dimension of the problem.
options.ObjectsSize=100; % m: number of objects
options.MaxIter=100; % MAXITER: maximum number of iterations
options.ObjFunction=@Ackley; % the name of the objective function
options.Display_Flag=1; % Flag for displaying results over iterations
options.run_parallel_index=0; % 1 for parallel processing
options.run=10;
if options.run_parallel_index
stream = RandStream('mrg32k3a');
parfor index=1:options.run
set(stream,'Substream',index);
RandStream.setGlobalStream(stream)
[Xbest, Fbest,FunctionEvolution_best]=ESDA_v1(options);
bestX_M(index,:)=Xbest;
Fbest_M(index)=Fbest;
fbest_evolution_M(index,:)=FunctionEvolution_best;
end
else
rng('default')
for index=1:options.run
[Xbest, Fbest,FunctionEvolution_best]=ESDA_v1(options);
bestX_M(index,:)=Xbest;
Fbest_M(index)=Fbest;
fbest_evolution_M(index,:)=FunctionEvolution_best;
end
end
[a,b]=min(Fbest_M);
figure
plot(1:options.MaxIter,fbest_evolution_M(b,:))
xlabel('Iterations')
ylabel('Fitness')
fprintf(' MIN=%g MEAN=%g MEDIAN=%g MAX=%g SD=%g \n',...
min(Fbest_M),mean(Fbest_M),median(Fbest_M),max(Fbest_M),std(Fbest_M))
3 仿真结果
4 参考文献
[1]李祥蓉. 静电放电算法-混合核SVM的月径流预报模型及应用[J]. 人民珠江, 2020, 41(1):6.
部分理论引用网络文献,若有侵权联系博主删除。
5 MATLAB代码与数据下载地址
见博客主页