-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitialization.m
52 lines (41 loc) · 2.36 KB
/
initialization.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
% 📜 Moss Growth Optimization (MGO) source codes (version 1.0)
% 🌐 Website and codes of MGO: Moss Growth Optimization: Concepts and Performance:
% 🔗 https://aliasgharheidari.com/MGO.html
% 👥 Boli Zheng, Yi Chen, Chaofan Wang, Ali Asghar Heidari, Lei Liu, Huiling Chen
% 📅 Last update: 9 05 2024
% 📜 After use of code, please users cite the main paper on MGO:
% Moss Growth Optimization: Concepts and Performance
% Boli Zheng, Yi Chen, Chaofan Wang, Ali Asghar Heidari, Lei Liu, Huiling Chen
% Journal of Computational Design and Engineering, 2024
%----------------------------------------------------------------------------------------------------------------------------------------------------%
% 📊 You can use and compare with other optimization methods developed recently:
% - (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
%____________________________________________________________________________________________________________________________________________________%
% This function initialize the first population of search agents
function Positions=initialization(SearchAgents_no,dim,ub,lb)
Boundary_no= size(ub,2); % numnber of boundaries
% If the boundaries of all variables are equal and user enter a signle
% number for both ub and lb
if Boundary_no==1
Positions=rand(SearchAgents_no,dim).*(ub-lb)+lb;
end
% If each variable has a different lb and ub
if Boundary_no>1
for i=1:dim
ub_i=ub(i);
lb_i=lb(i);
Positions(:,i)=rand(SearchAgents_no,1).*(ub_i-lb_i)+lb_i;
end
end