-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.m
38 lines (29 loc) · 831 Bytes
/
main.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
clear; clc;
addpath('bf');
% Minimum allowed fitness
minFit = 1e-12;
% Independent runs
runs = 3;
% cec 2010 functions
func = [1,2,3,4,5,6];
% Dimension
D = 1000;
% Parameters
maxFe = 3e+6; % Maximum Fitness Evolution
nPop = 50; % Population Size (Swarm Size)
% Running CCCDE
tic
for fn = 1:length(func)
file_res = strcat('res\resccde_', num2str(D), '.txt');
fileID_res = fopen(file_res, 'a');
fprintf(fileID_res, 'Func_%d:', fn);
for i=1:runs
disp('Running CCDE ...');
[varMin, varMax] = range(func(fn));
[bestCC] = ccde(D, maxFe, minFit, nPop, func(fn), varMin, varMax);
disp('CCDE Finished ...');
fprintf(fileID_res, ' %e', bestCC);
end
fprintf(fileID_res, '\n');
fclose(fileID_res);
end