✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

​智能优化算法​​​  ​​神经网络预测​​​ ​​雷达通信 ​​​ ​​无线传感器​

​信号处理​​​ ​​图像处理​​​ ​​路径规划​​​ ​​元胞自动机​​​ ​​无人机 ​​​ ​​电力系统​

⛄ 内容介绍

式方法之一是黑猩猩优化算法 (ChOA),其灵感来自黑猩猩在群体狩猎中的个体智力和性动机。本文提出了一种加权ChOA(WChOA)替代方案,以解决大规模数值优化问题中出现的两个主要问题,例如低收敛速度和在解决高维问题时陷入局部最优。标准 ChOA 和 WChOA 之间的主要区别在于提供了位置加权方程以增强收敛性速度并避免局部最优。此外,探索和利用之间的平衡在所提出的方法中进行,这在基于群体智能的算法中至关重要。所提出的 WChOA 方法在不同的条件下进行评估,以证明它是最好的。为此,应用了一组经典单峰、多峰和固定维度多峰基准函数来研究 WChOA 特征的优缺点。此外,WChOA 在 IEEE Congress of Evolutionary Computation 基准测试功能(CECC06, 2019 Competition)上进行了测试。更深入地探讨WChOA 在大规模数值优化和现实世界中的性能问题,WChOA 由 13 个高维和 10 个实际优化问题进行检查。结果表明,与文献中的最新方法(如 ChOA、PSO 、BBO、WOA、 BH、ALO、GA、SCA 和 GWO。

加权黑猩猩优化算法(WChOA)附Matlab代码_优化算法

⛄ 部分代码

%__________________________________________

% fobj = @YourCostFunction

% dim = 变量数

% Max_iteration = 最大代数

% SearchAgents_no = 搜索代理的数量

% lb=[lb1,lb2,...,lbn] 其中 lbn 是变量 n 的下限

% ub=[ub1,ub2,...,ubn] 其中 ubn 是变量 n 的上限

% 如果所有变量的下限相等,你可以

% 定义 lb 和 ub 为两个单数


%

%__________________________________________


清除所有 

clc


SearchAgents_no=30; % 搜索代理数量

N=SearchAgents_no;

函数名='F14'; % 测试函数名称,可以从F1到F23(论文中的表3,4,5)


最大迭代=500;% 最大迭代次数

Max_iter=Max_iteration;


% 加载所选基准函数的详细信息

[lb,ub,dim,fobj]=Get_Functions_details(Function_name);



[ABest_scoreChimp,ABest_posChimp,Chimp_curve]=Chimp(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);

[WABest_scoreChimp,WABest_posChimp,WCimp_curve]=WCimp(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);

[PSO_gBestScore,PSO_gBest,PSO_cg_curve]=PSO(N,Max_iteration,lb,ub,dim,fobj);

[TACPSO_gBestScore,TACPSO_gBest,TACPSO_cg_curve]=TACPSO(N,Max_iteration,lb,ub,dim,fobj);

[MPSO_gBestScore,MPSO_gBest,MPSO_cg_curve]=MPSO(N,Max_iteration,lb,ub,dim,fobj);


% PSO_cg_curve=PSO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); % run PSO to compare to results


figure('Position',[500 500 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(MPSO_cg_curve,'Color','g')

hold on

semilogy(PSO_cg_curve,'Color','b')

hold on

semilogy(TACPSO_cg_curve,'Color','y')

hold on

semilogy(Chimp_curve,'--r')

hold on

semilogy(WChimp_curve,'r')


title('Objective space')

xlabel('Iteration');

ylabel('Best score obtained so far');


axis tight

grid on

box on

legend('MPSO','PSO','TACPSO','Chimp','WChimp')

img =gcf;  %获取当前画图的句柄

print(img, '-dpng', '-r600', './img.png')         %即可得到对应格式和期望dpi的图像

display(['The best optimal value of the objective funciton found by TACPSO is : ', num2str(TACPSO_gBestScore)]);

display(['The best optimal value of the objective funciton found by PSO is : ', num2str(PSO_gBestScore)]);

display(['The best optimal value of the objective funciton found by PSO is : ', num2str(MPSO_gBestScore)]);

display(['The best optimal value of the objective funciton found by Chimp is : ', num2str(ABest_scoreChimp)]);

display(['The best optimal value of the objective funciton found by WChimp is : ', num2str(WABest_scoreChimp)]);

⛄ 运行结果

加权黑猩猩优化算法(WChOA)附Matlab代码_优化算法_02

⛄ 参考文献

Khishe, M. 和 MR Mosavi。“黑猩猩优化算法。” 具有应用程序的专家系统,第一卷。149,Elsevier BV,2020 年 7 月,第 113338,doi:10.1016/j.eswa.2020.113338。

❤️ 关注我领取海量matlab电子书和数学建模资料
❤️部分理论引用网络文献,若有侵权联系博主删除