%  Planet Optimization Algorithm (POA) source code (Developed in MATLAB)
%
%
%  Paper:Forecasting of excavation problems for high-rise building in Vietnam using planet optimization algorithm
%  (https://doi.org/10.1038/s41598-021-03097-y) 
%
%  Thanh Sang-To, Hoang-Le Minh, Samir Khatir, Seyedali Mirjalili, Magd Abdel Wahab, Thanh Cuong-Le 
%
%  Email: sang.tt@ou.edu.vn, minhhoang.le@ugent.be, magd.abdelwahab@ugent.be, cuong.lt@ou.edu.vn
%  Programming: Thanh Sang-To
%  Scientific Reports
%%
 clear all;clc
 close all
 
 N=30;               % Number of population
 T_max=500;          % Maximum of iteration

 Function_name='F1'; % Name of function
 

 [Xsun,Gsun,convergence]=POA(N,T_max,Function_name);

 % PLot convergence curve
 plot(1:size(convergence,2),convergence,'r','linewidth',2);
 title(['\fontsize{20}\bf',num2str(Function_name),' Function']);
 xlabel('\fontsize{20}\bf Iteration');
 ylabel('\fontsize{20}\bf Best value');
 set(gca, 'YScale', 'log')
 legend('POA','FontSize',12,'FontName', 'Times New Roman');
 set(gca,'FontSize',12,'FontName', 'Times New Roman')
 
 % Print the best solution
 display(['The best solution obtained by POA : ', num2str(Xsun)]);
 display(['The best value of Function : ', num2str(Gsun)]);

 


