-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInitializingPeaks.m
165 lines (165 loc) · 6.69 KB
/
InitializingPeaks.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
159
160
161
162
163
164
165
%*********************************Generalized Moving Peaks Benchmark (GMPB)****************************************
%Author: Danial Yazdani
%Last Edited: January 15, 2020
%
% ------------
% Reference:
% ------------
%
% D. Yazdani et al.,
% "Benchmarking Continuous Dynamic Optimization: Survey and Generalized Test Suite,"
% IEEE Transactions on Cybernetics (2020).
%
% --------
% License:
% --------
% This program is to be used under the terms of the GNU General Public License
% (http://www.gnu.org/copyleft/gpl.html).
% Author: Danial Yazdani
% e-mail: danial.yazdani AT gmail dot com
% danial.yazdani AT yahoo dot com
% Copyright notice: (c) 2020 Danial Yazdani
%**************************************************************************************************
function MPB = InitializingPeaks(d,ii,D,ScenarioNumber)
MPB.id = ii;
MPB.Dimension = d;
MPB.MinCoordinate = -50;
MPB.MaxCoordinate = 50;
MPB.MinHeight = 30;
MPB.MaxHeight = 70;
MPB.MinWidth = 1;
MPB.MaxWidth = 12;
MPB.MinAngle = -pi;
MPB.MaxAngle =pi;
MPB.MaxTau = 0.4;
MPB.MinTau = 0;
MPB.MaxEta = 25;
MPB.MinEta = 10;
switch ScenarioNumber
case 1%Traditional MPB (default setting)
MPB.Weight = (d/D) * 1;%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 25;
MPB.ShiftSeverity = 2;
MPB.HeightSeverity = 7;
MPB.WidthSeverity = 1;
MPB.AngleSeverity = 0;
MPB.TauSeverity = 0;
MPB.EtaSeverity = 0;
MPB.EllipticalPeaks= 0;
MPB.InitialRotationMatrix = repmat(eye(d),1,1,MPB.PeakNumber);%Using Identity matrices for rotation does not rotate peaks.
case 2
MPB.Weight = (d/D) * 1;%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 25;
MPB.ShiftSeverity = 2;
MPB.HeightSeverity = 7;
MPB.WidthSeverity = 1;
MPB.AngleSeverity = pi/9;
MPB.TauSeverity = 0;
MPB.EtaSeverity = 0;
MPB.EllipticalPeaks= 1;
MPB.InitialRotationMatrix = NaN(d,d,MPB.PeakNumber);
for ii=1 : MPB.PeakNumber
[MPB.InitialRotationMatrix(:,:,ii) , ~] = qr(rand(d));
end
case 3
MPB.Weight = (d/D) * 1;%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 25;
MPB.ShiftSeverity = 2;
MPB.HeightSeverity = 7;
MPB.WidthSeverity = 1;
MPB.AngleSeverity = 0;
MPB.TauSeverity = 0.05;
MPB.EtaSeverity = 2;
MPB.EllipticalPeaks= 0;
MPB.InitialRotationMatrix = repmat(eye(d),1,1,MPB.PeakNumber);%Using Identity matrices for rotation does not rotate peaks.
case 4
MPB.Weight = (d/D) * 1;%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 25;
MPB.ShiftSeverity = 2;
MPB.HeightSeverity = 7;
MPB.WidthSeverity = 1;
MPB.AngleSeverity = pi/9;
MPB.TauSeverity = 0.05;
MPB.EtaSeverity = 2;
MPB.EllipticalPeaks= 1;
MPB.InitialRotationMatrix = NaN(d,d,MPB.PeakNumber);
for ii=1 : MPB.PeakNumber
[MPB.InitialRotationMatrix(:,:,ii) , ~] = qr(rand(d));
end
case 5
MPB.Weight = (d/D) * (0.5 + rand*2.5);%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 14 + ceil(rand*21);%in{5...15}
MPB.ShiftSeverity = 1 + rand*2;
MPB.HeightSeverity = 5 + rand*4;
MPB.WidthSeverity = 0.5 + rand*1;
MPB.AngleSeverity = 0;
MPB.TauSeverity = 0;
MPB.EtaSeverity = 0;
MPB.EllipticalPeaks= 0;
MPB.InitialRotationMatrix = repmat(eye(d),1,1,MPB.PeakNumber);%Using Identity matrices for rotation does not rotate peaks.
case 6
MPB.Weight = (d/D) * (0.5 + rand*2.5);%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 14 + ceil(rand*21);%in{5...15}
MPB.ShiftSeverity = 1 + rand*2;
MPB.HeightSeverity = 5 + rand*4;
MPB.WidthSeverity = 0.5 + rand*1;
MPB.AngleSeverity = (pi/12) + rand*(pi/12);
MPB.TauSeverity = 0;
MPB.EtaSeverity = 0;
MPB.EllipticalPeaks= 1;
MPB.InitialRotationMatrix = NaN(d,d,MPB.PeakNumber);
for ii=1 : MPB.PeakNumber
[MPB.InitialRotationMatrix(:,:,ii) , ~] = qr(rand(d));
end
case 7
MPB.Weight = (d/D) * (0.5 + rand*2.5);%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 14 + ceil(rand*21);%in{5...15}
MPB.ShiftSeverity = 1 + rand*2;
MPB.HeightSeverity = 5 + rand*4;
MPB.WidthSeverity = 0.5 + rand*1;
MPB.AngleSeverity = 0;
MPB.TauSeverity = 0.025 + rand*0.05;
MPB.EtaSeverity = 1 + rand*2;
MPB.EllipticalPeaks = 0;
MPB.InitialRotationMatrix = repmat(eye(d),1,1,MPB.PeakNumber);%Using Identity matrices for rotation does not rotate peaks.
case 8
MPB.Weight = (d/D) * (0.5 + rand*2.5);%automatic weight (Eq.17) * manual weight (Eq.18);
MPB.PeakNumber = 14 + ceil(rand*21);%in{5...15}
MPB.ShiftSeverity = 1 + rand*2;
MPB.HeightSeverity = 5 + rand*4;
MPB.WidthSeverity = 0.5 + rand*1;
MPB.AngleSeverity = (pi/12) + rand*(pi/12);
MPB.TauSeverity = 0.025 + rand*0.05;
MPB.EtaSeverity = 1 + rand*2;
MPB.EllipticalPeaks = 1;
MPB.InitialRotationMatrix = NaN(d,d,MPB.PeakNumber);
for ii=1 : MPB.PeakNumber
[MPB.InitialRotationMatrix(:,:,ii) , ~] = qr(rand(d));
end
end
if MPB.EllipticalPeaks==1
MPB.PeaksWidth = MPB.MinWidth + (MPB.MaxWidth-MPB.MinWidth)*rand(MPB.PeakNumber,d);
else
MPB.PeaksWidth = MPB.MinWidth + (MPB.MaxWidth-MPB.MinWidth)*repmat(rand(MPB.PeakNumber,1),1,d);
end
if d>1%there is no ill-conditioning and rotation in 1-dimensional MPBs
MPB.RotationMatrix = MPB.InitialRotationMatrix;
else
MPB.RotationMatrix = repmat(eye(d),1,1,MPB.PeakNumber);
MPB.AngleSeverity = 0;
end
MPB.PeaksPosition = MPB.MinCoordinate + ((MPB.MaxCoordinate-MPB.MinCoordinate)*rand(MPB.PeakNumber,MPB.Dimension));
MPB.PeaksHeight = MPB.MinHeight + (MPB.MaxHeight-MPB.MinHeight)*rand(MPB.PeakNumber,1);
if MPB.AngleSeverity==0
MPB.PeaksAngle = zeros(MPB.PeakNumber,1);
else
MPB.PeaksAngle = MPB.MinAngle + (MPB.MaxAngle-MPB.MinAngle)*rand(MPB.PeakNumber,1);
end
if MPB.EtaSeverity==0 && MPB.TauSeverity==0
MPB.tau = zeros(MPB.PeakNumber,1);
MPB.eta = zeros(MPB.PeakNumber,4);
else
MPB.tau = MPB.MinTau + (MPB.MaxTau-MPB.MinTau)*rand(MPB.PeakNumber,1);
MPB.eta = MPB.MinEta + (MPB.MaxEta-MPB.MinEta)*rand(MPB.PeakNumber,4);
end
end