小工具知识网

当前位置: 首页 > 行业知识 > 2024最新算法:冠豪猪优化算法(Crested Porcupine Optimizer,CPO)求解23个基准函数(提供MATLAB代码)

行业知识

2024最新算法:冠豪猪优化算法(Crested Porcupine Optimizer,CPO)求解23个基准函数(提供MATLAB代码)

2026-11-05 09:52:26 来源:互联网转载

一、冠豪猪优化算法

��豪猪优化算法(Crested Porcupine Optimizer,CPO)由Mohamed Abdel-Basset等人于2024年提出,该算法模拟冠豪猪的四种不同保护机制:视觉、听觉、气味和物理攻击。第一和第二防御技术(视觉和听觉)反映了CPO的探索行为,而第三和第四防御策略(气味和物理攻击)反映了CPO的剥削行为。该算法提出了一种称为循环种群减少技术的新策略,以模拟并非所有CP激活其防御机制,而只激活那些受到威胁的CP的介词。这种策略促进了趋同率和种群多样性。

[1]Abdel-Basset M, Mohamed R, Abouhawwash M. Crested Porcupine Optimizer: A new nature-inspired metaheuristic[J]. Knowledge-Based Systems, 2024, 284: 111257.

二、23个函数介绍

参考文献:

[1] Yao X, Liu Y, Lin G M. Evolutionary programming made faster[J]. IEEE transactions on evolutionary computation, 1999, 3(2):82-102.

三、CPO求解23个函数

3.1部分代码

close all ;clearclcNpop=30;                Function_name='F1';     % Name of the test function that can be from F1 to F23 ( Tmax=500;              [lb,ub,dim,fobj]=Get_Functions_details(Function_name);[Best_fit,Best_pos,Convergence_curve]=CPO(Npop,Tmax,lb,ub,dim,fobj);figure('Position',[100 100 660 290])%Draw search spacesubplot(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 spacesubplot(1,2,2);semilogy(Convergence_curve,'Color','r','linewidth',3)title('Search space')xlabel('Iteration');ylabel('Best score obtained so far');axis tightgrid onbox onlegend('CPO')saveas(gca,[Function_name '.jpg']);display(['The best solution is ', num2str(Best_pos)]);display(['The best fitness value is ', num2str(Best_fit)]);

3.2部分结果

四、完整MATLAB代码

文件夹夹内包含该算法求解23个函数的完整MATLAB代码,点击main.m即可运行。

上一篇:Discuz手机模板入门教程,一键操作,让你的移动站点魅力焕发!

下一篇:幻影服务器250怎么玩?