-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtuning_ncycle_calc.py
34 lines (26 loc) · 1.01 KB
/
tuning_ncycle_calc.py
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
import pygmo as pg
from utils.pygmo_utils import calculate_mean_rbf
from utils.utils import save_values
# where n is the number of times the meta-heuristic algorithms are run to get the mean
n = 10
dim = 30
problem_name = 'zdt'
problem_number = 6
max_fevals = (dim + 1) * 50
# To account for the fact that the zero index array in util functions
# are actually the 1st feval
working_fevals = max_fevals-1
pop_size = 24
seed = 33
default_rf = 3
# For the each problem in the problem suite
for i in range(5, problem_number):
# Skip problem 5
if i == 4:
continue
problem_function = getattr(pg.problems, problem_name)
problem = pg.problem(problem_function(i+1, param=dim))
for cycle_mult in range(3):
cycle = (cycle_mult+1) * default_rf
hv_rbfmopt_plot = calculate_mean_rbf(n, max_fevals, working_fevals, seed, problem, cycle, None)
save_values('store_hv/rbfmopt_hv_cycle' + str(cycle) + '_' + problem.get_name() + '_fevals' + str(max_fevals) + '.txt', hv_rbfmopt_plot.tolist())