forked from PwnerHarry/SOOPLAT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunBenchmark.m
43 lines (43 loc) · 1.17 KB
/
runBenchmark.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
clear all;
mode = 'test';
MAX_TRACE_POINTS = 1001;
algorithms = {'CSO'};
suite = 'LSO08';
function_index = 1;
runtimes = 1;
dimension = 1000;
evaluation = dimension * 3e3;
DIR = 'Data';
mkdir(DIR);
Globals = {};
pointer = 1;
for R = 1: runtimes
for i = function_index
for j = 1: numel(algorithms)
Globals{pointer} = GLOBAL('-algorithm', algorithms{j}, '-evaluation', evaluation, '-dimension', dimension, '-problem', sprintf('%sF%d', suite, i));
pointer = pointer + 1;
end
end
pause(1);
end
pointer = 1;
drawnow;
error_list = [];
while pointer <= numel(Globals)
if strcmp(mode, 'benchmark')
try
feval(Globals{pointer}.algorithm, Globals{pointer});
catch ME
error_list = [error_list, pointer];
end
elseif strcmp(mode, 'test')
feval(Globals{pointer}.algorithm, Globals{pointer});
end
G = Globals{pointer};
G.reduceTrace(MAX_TRACE_POINTS);
renderCurve(G);
filename = sprintf('[%s]%s_%s_D%d.mat', G.identifier, G.algorithm, G.problem.name, G.problem.dimension);
save(fullfile(DIR, filename), 'G');
pointer = pointer + 1;
end
error_Globals = Globals(error_list);