【黏菌优化算法】基于自适应对抗粘菌优化算法求解单目标优化我问他 (AOSMA)含Matlab源码
【黏菌优化算法】基于自适应对抗粘菌优化算法求解单目标优化我问他 (AOSMA)含Matlab源码
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
1 简介
黏菌优化算法(Slime mould algorithm,SMA)由 Li等于 2020 年提出,其灵感来自于黏菌的扩散和觅食行为,属于元启发算法。具有收敛速度快,寻优能力强的特点。 黏菌优化算法用数学模型模仿黏菌觅食行为和形态变化 , SMA 包括三个阶段 , 分别为接近食物阶段 、 包围食物阶段和抓 取食物阶段 。
2 部分代码
%
Adaptive Opposition Slime Mould
Algorithm
(
AOSMA
) source Code Version 1.0
%
clearvars
close all
clc
disp
(
’The AOSMA is tracking the problem’
)
;
N=
30
; % Number of slime mould
Function_name=
’F1’
; % Name of the test function that can be
from
F1 to F23
MaxIT=
500
; % Maximum number of iterations
[
lb,ub,dim,fobj
]=Get_Functions_details(Function_name); % Function details
Times=
21
; %
Number of independent times you want to run the AOSMA
display
(
[
’Number of independent runs: ’
, num2str(Times
)])
;
for
i=
1
:Times
[
Destination_fitness(i),bestPositions(i,:),Convergence_curve(i,:)
]=AOSMA(N,MaxIT,lb,ub,dim,fobj);
display([
’The optimal fitness of AOSMA is: ’
, num2str(Destination_fitness(i))]);
end
[
bestfitness,index
]=min(Destination_fitness);
disp(
’--------Best Fitness, Average Fitness, Standard Deviation and Best Solution--------’
);
display([
’The best fitness of AOSMA is: ’
, num2str(bestfitness)]);
display([
’The average fitness of AOSMA is: ’
, num2str(mean(Destination_fitness))]);
display([
’The standard deviation fitness of AOSMA is: ’
, num2str(std(Destination_fitness))]);
display([
’The best location of AOSMA is: ’
, num2str(bestPositions(index,:))]);
figure(
’Position’
,[
269
240
660
290
])
%
Draw search space
subplot
(
1
,
2
,
1
)
;
func_plot(Function_name);
title(
’Parameter space’
)
xlabel(
’x_1’
);
ylabel(
’x_2’
);
zlabel([Function_name,
’( x_1 , x_2 )’
])
%
Draw objective space
subplot
(
1
,
2
,
2
)
;
semilogy(Convergence_curve(index,:),
’Color’
,
’r’
,
’linewidth’
,
2.5
);
title(
’Objective space’
)
xlabel(
’Iteration’
);
ylabel(
’Best score obtained so far’
);
legend(
’AOSMA’
);
axis tight
grid
on
box
on
3 仿真结果
4 参考文献
[1]郭雨鑫,刘升,张磊,黄倩.精英反向与二次插值改进的黏菌算法[J/OL].计算机应用研究:1-7
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
-
2023年血糖新标准公布,不是3.9-6.1,快来看看你的血糖正常吗? 2023-02-07
-
2023年各省最新电价一览!8省中午执行谷段电价! 2023-01-03
-
GB 55009-2021《燃气工程项目规范》(含条文说明),2022年1月1日起实施 2021-11-07
-
PPT导出高分辨率图片的四种方法 2022-09-22
-
2023年最新!国家电网27家省级电力公司负责人大盘点 2023-03-14
-
全国消防救援总队主官及简历(2023.2) 2023-02-10
-
盘点 l 中国石油大庆油田现任领导班子 2023-02-28
-
我们的前辈!历届全国工程勘察设计大师完整名单! 2022-11-18
-
关于某送变电公司“4·22”人身死亡事故的快报 2022-04-26
