-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinitialization.m
58 lines (43 loc) · 3.05 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
53
54
55
56
57
58
%___________________________________________________________________________________________________________________________________________________%
% Parrot Optimizer (PO) source codes (version 2.0)
% PO
% Parrot optimizer: Algorithm and applications to medical problems
% Website and codes of Parrot optimizer(PO):http://www.aliasgharheidari.com/PO.html
% Junbo Lian, Guohua Hui, Ling Ma, Ting Zhu, Xincan Wu, Ali Asghar Heidari, Yi Chen, Huiling Chen
% Last update: Apr 07 2024
% E-Mail: as_heidari@ut.ac.ir, aliasghar68@gmail.com, chenhuiling.jlu@gmail.com
%----------------------------------------------------------------------------------------------------------------------------------------------------%
% Authors: Junbo Lian (junbolian@qq.com), Ali Asghar Heidari(as_heidari@ut.ac.ir, aliasghar68@gmail.com), Huiling Chen(chenhuiling.jlu@gmail.com)
%----------------------------------------------------------------------------------------------------------------------------------------------------%
% After use of code, please users cite to the main paper on Parrot optimizer (PO):
% Junbo Lian, Guohua Hui, Ling Ma, Ting Zhu, Xincan Wu, Ali Asghar Heidari, Yi Chen, Huiling Chen*
% Parrot optimizer: Algorithm and applications to medical problems
% Computers in Biology and Medicine, ELSEVIER - 2024
%----------------------------------------------------------------------------------------------------------------------------------------------------%
% You can also follow the paper for related updates in researchgate:
% https://www.researchgate.net/profile/Ali_Asghar_Heidari.
% Website and codes of Parrot optimizer (PO):% http://www.aliasgharheidari.com/PO.html
% You can also use and compare with our other new optimization methods:
%(RIME)-2023-http://www.aliasgharheidari.com/RIME.html
%(INFO)-2022- http://www.aliasgharheidari.com/INFO.html
%(RUN)-2021- http://www.aliasgharheidari.com/RUN.html
%(HGS)-2021- http://www.aliasgharheidari.com/HGS.html
%(SMA)-2020- http://www.aliasgharheidari.com/SMA.html
%(HHO)-2019- http://www.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