-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.m
75 lines (57 loc) · 2.85 KB
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
% 📜 Escape source codes (version 1.0)
% 🌐 Website and codes of ESC: Escape: An optimization method based on crowd evacuation behaviors:
% 🔗 https://aliasgharheidari.com/ESC.html
% 👥 Kaichen OuYang, Shengwei Fu, Yi Chen, Qifeng Cai, Ali Asghar Heidari, Huiling Chen
% 📅 Last update: 10 26 2024
% 📜 After use of code, please users cite the main paper on ESC:
% Escape: An optimization method based on crowd evacuation behaviors
% Kaichen OuYang, Shengwei Fu, Yi Chen, Qifeng Cai, Ali Asghar Heidari, Huiling Chen
% Journal of Artificial intelligence review, 2024
%----------------------------------------------------------------------------------------------------------------------------------------------------%
% 📊 You can use and compare with other optimization methods developed recently:
- (ESC) 2024: 🔗 https://aliasgharheidari.com/ESC.html
% - (MGO) 2024: 🔗 https://aliasgharheidari.com/MGO.html
% - (PLO) 2024: 🔗 https://aliasgharheidari.com/PLO.html
% - (FATA) 2024: 🔗 https://aliasgharheidari.com/FATA.html
% - (ECO) 2024: 🔗 https://aliasgharheidari.com/ECO.html
% - (AO) 2024: 🔗 https://aliasgharheidari.com/AO.html
% - (PO) 2024: 🔗 https://aliasgharheidari.com/PO.html
% - (RIME) 2023: 🔗 https://aliasgharheidari.com/RIME.html
% - (INFO) 2022: 🔗 https://aliasgharheidari.com/INFO.html
% - (RUN) 2021: 🔗 https://aliasgharheidari.com/RUN.html
% - (HGS) 2021: 🔗 https://aliasgharheidari.com/HGS.html
% - (SMA) 2020: 🔗 https://aliasgharheidari.com/SMA.html
% - (HHO) 2019: 🔗 https://aliasgharheidari.com/HHO.html
%____________________________________________________________________________________________________________________________________________________%
clc
clear
close all
%%
for Function_name = 1:30
nPop = 30 ; % number of population
Max_iter = 500 ; % maximum number of iterations
dim = 30 ; % The value can be 2, 10, 30, 50, 100
%% select function
% Function_name= 30 ; % function name: 1 - 30
[lb,ub,dim,fobj] = Get_Functions_cec2017(Function_name,dim);
%% Escape algorithm
tic
[ESC_Best_score,ESC_Best_pos,ESC_cg_curve]=ESC(nPop,Max_iter,lb,ub,dim,fobj);
toc
display(['The best optimal value of the objective funciton found by ESC for F' [num2str(Function_name)],' is: ', num2str(ESC_Best_score)]);
fprintf ('Best solution obtained by ESC: %s\n', num2str(ESC_Best_pos,'%e '));
%% plot
% figure('Position',[400 200 300 250])
figure
semilogy(ESC_cg_curve,'y','Linewidth',2)
title(['CEC2017-F',num2str(Function_name), ' (Dim=' num2str(dim), ')'])
xlabel('Iteration');
ylabel(['Best score F' num2str(Function_name) ]);
axis tight
grid on
box on
set(gca,'color','none')
legend('ESC')
pause(1)
end