forked from bicep/RBFMOpt-Benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecvar_csv_gen.py
34 lines (26 loc) · 1.02 KB
/
decvar_csv_gen.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 gen_csv
# where n is the number of times the meta-heuristic algorithms are run to get the mean
n = 1
problem_name = 'zdt'
problem_number = 6
# To account for the fact that the zero index array in util functions
# are actually the 1st feval
pop_size = 24
seed = 33
default_rf = 3
# i is the problem number chosen
i = 4
dim = 30
problem_function = getattr(pg.problems, problem_name)
problem = pg.problem(problem_function(i, param=dim))
max_fevals = 110
working_fevals = max_fevals-1
file_string = '/Users/rogerko/dev/Opossum/benchmark/csv/benchmark_problem' + str(i) + '_dvar' + str(dim) + '.txt'
stream = open(file_string, 'a')
hv_rbfmopt_plot = calculate_mean_rbf(n, max_fevals, working_fevals, seed, problem, default_rf, output_stream=stream)
stream.close()
csv_file_string = '/Users/rogerko/dev/Opossum/benchmark/csv/benchmark_problem' + str(i) + '_dvar' + str(dim) + '.csv'
# load the txt file and gen csv
gen_csv(file_string, csv_file_string)