1 简介
闪电连接过程算法( Lightning Attachment Procedure Optimization,LAPO)是受自然界中闪电上迎先导与下行先导连接过程的启发,于2017年提出的一种新型智能算法。该算法具有收敛速度快,精度高等特点。
2 部分代码
%___________________________________________________________________%
% Lightning Attachment Procedure Optimization (LAPO) source codes demo version 1.0 %
% %
% Developed in MATLAB R2015b %
% %
% %
%___________________________________________________________________%
% You can simply define your cost in a seperate file and load its handle to fobj
% The initial parameters that you need are:
%__________________________________________
% fobj = @YourCostFunction
% dim = number of your variables
% Max_iteration = maximum number of generations
% SearchAgents_no = number of search agents
% lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
% ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers
% To run LAPO_main: [Best_score,Best_pos,cg_curve]=LAPO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj)
clc
clear
close all
Function_name='F4'; % Name of the test function
SearchAgents_no=40; % Number of test point
Max_iteration=1000; % Maximum numbef of iterations
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
tic
[Best_score,Best_pos,cg_curve]=LAPO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
toc
figure('Position',[300 300 660 290])
%Draw search space
subplot(1,2,1);
func_plot(Function_name);
title('Test function')
xlabel('x_1');
ylabel('x_2');
zlabel([Function_name,'( x_1 , x_2 )'])
grid off
% Draw objective space
subplot(1,2,2);
semilogy(cg_curve,'Color','r','linewidth',2)
title('Convergence curve')
xlabel('Iteration');
ylabel('Best score obtained so far');
axis tight
grid off
box on
legend('LAPO')
display(['The best solution obtained by LAPO is : ', num2str(Best_pos)]);
display(['The best optimal value of the objective funciton found by LAPO is : ', num2str(Best_score)]);
3 仿真结果
4 参考文献
[1]王春枝, 邢绍文, 严灵毓,等. 改进闪电连接过程优化算法的网络流量预测方法及系统:.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。