-
Notifications
You must be signed in to change notification settings - Fork 1
/
f_ISSA.m
158 lines (117 loc) · 3.8 KB
/
f_ISSA.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
function [mbest,stdbest,sem,mFEs,SR,pos,cg_curve] = f_ISSA(N,Max_iter,RUNS,M,mat_HOS,SNR,Nt,lMC)
FEs = 0;
runs = 1;
lb = zeros(15,1);
ub = 1e3*ones(15,1);
dim = length(lb);
accep_level = .08;
CostFunction = @(x,M,mat_HOS,SNR,Nt,lMC) f_ObjFct(x,M,mat_HOS,SNR,Nt,lMC); % Ojbective function
while runs <= RUNS
%Initialize the positions of salps
SalpPositions=initialization(N,dim,ub,lb);
FoodPosition=zeros(1,dim);
FoodFitness=inf;
cMax=1;
cMin=0.00003;
%calculate the fitness of initial salps
for i=1:size(SalpPositions,1)
SalpFitness(1,i)=CostFunction(SalpPositions(i,:),M,mat_HOS,SNR,Nt,lMC);
FEs = FEs + 1;
all_cost(FEs) = SalpFitness(1,i);
cg_curve(runs,FEs) = SalpFitness(1,i);
end
[sorted_salps_fitness,sorted_indexes]=sort(SalpFitness);
for newindex=1:N
Sorted_salps(newindex,:)=SalpPositions(sorted_indexes(newindex),:);
end
FoodPosition=Sorted_salps(1,:);
FoodFitness=sorted_salps_fitness(1);
%Main loop
l=2; % start from the second iteration since the first iteration was dedicated to calculating the fitness of salps
while l<Max_iter+1
c=cMax*rand-l*((cMax-cMin)/Max_iter);
c1 = 2*exp(-(4*l/Max_iter)^2); % Eq. (3.2) in the paper
for i=1:size(SalpPositions,1)
SalpPositions= SalpPositions';
if i<=N/2
for j=1:1:dim
c2=rand();
c3=rand();
%%%%%%%%%%%%% % Eq. (3.1) in the paper %%%%%%%%%%%%%%
if c3<0.5
SalpPositions(j,i)=FoodPosition(j)+c1*((ub(j)-lb(j))*c2+lb(j));
else