二、部分源代码

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))


三、运行结果

【优化算法】静电放电优化算法(ESDA)【含Matlab源码 1439期】_matlab

四、matlab版本及参考文献

1 matlab版本

2014a

2 参考文献

[1] 包子阳,余继周,杨杉.智能优化算法及其MATLAB实例(第2版)[M].电子工业出版社,2016.

[2]张岩,吴水根.MATLAB优化算法源代码[M].清华大学出版社,2017.