一、星雀优化算法
星雀优化算法(Nutcracker optimizer algorithm,NOA)由Mohamed Abdel-Basset等人于2023年提出,该算法模拟星雀的两种行为,即:在夏秋季节收集并储存食物,在春冬季节搜索食物的存储位置。CEC2005:星雀优化算法(Nutcracker optimizer algorithm,NOA)求解CEC2005(提供MATLAB代码)-CSDN博客
参考文献:
Mohamed Abdel-Basset, Reda Mohamed, Mohammed Jameel, Mohamed Abouhawwash.Nutcracker optimizer: A novel nature-inspired metaheuristic algorithm for global optimization and engineering design problems[J]. Knowledge-Based Systems,2023,262.
二、部分代码
clc clear close all tic %% 地图 global G S E G=[0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0; 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0; 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0; 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0; 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0; 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0; 0 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0; 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0; 0 0 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 0; 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0; 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0; 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0; 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0; 1 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 1 1 0; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0; 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0; 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0;]; for i=1:20/2 for j=1:20 m=G(i,j); n=G(21-i,j); G(i,j)=n; G(21-i,j)=m; end end %% S = [1 1]; %起点 E = [20 20]; %终点 [ub,dimensions] = size(G); dim = dimensions - 2; %% 参数设置 Max_iter= 200; % 最大迭代次数 SearchAgents_no = 50; % 种群数量 X_min = 1; lb=1; fobj=@(x)fitness(x); [Best_score,Best_NC,Convergence_curve]=NOA(SearchAgents_no,Max_iter,lb,ub,dim,fobj);
三、部分结果
四、完整MATLAB代码
新雀优化算法NOA求解机器人栅格地图最短路径规划,可以自定义地图(提供MATLAB代码)