一、冠豪豬優化算法
冠豪豬優化算法(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 ; clear clc Npop=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 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,'Color','r','linewidth',3) title('Search space') xlabel('Iteration'); ylabel('Best score obtained so far'); axis tight grid on box on legend('CPO') saveas(gca,[Function_name '.jpg']);display(['The best solution is ', num2str(Best_pos)]); display(['The best fitness value is ', num2str(Best_fit)]);