-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
93 lines (50 loc) · 2.06 KB
/
config.py
File metadata and controls
93 lines (50 loc) · 2.06 KB
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
import os
import tensorflow as tf
import time
# disable gpu
# tf.config.set_visible_devices([], 'GPU')
#
# _____ _ _ _
# | __ \ (_) | | (_)
# | | | | _ _ __ ___ ___ | |_ ___ _ __ _ ___ ___
# | | | || || '__|/ _ \ / __|| __|/ _ \ | '__|| | / _ \/ __|
# | |__| || || | | __/| (__ | |_| (_) || | | || __/\__ \
# |_____/ |_||_| \___| \___| \__|\___/ |_| |_| \___||___/
#
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
root_dir = os.path.join(parent_dir, 'combench')
results_dir = os.path.join(root_dir, 'results')
database_dir = os.path.join(root_dir, 'database')
if not os.path.exists(results_dir):
os.makedirs(results_dir)
if not os.path.exists(database_dir):
os.makedirs(database_dir)
plots_dir = os.path.join(root_dir, 'plots')
if not os.path.exists(plots_dir):
os.makedirs(plots_dir)
plots_test_dir = os.path.join(plots_dir, 'test')
if not os.path.exists(plots_test_dir):
os.makedirs(plots_test_dir)
plots_problems_dir = os.path.join(plots_dir, 'problems')
if not os.path.exists(plots_problems_dir):
os.makedirs(plots_problems_dir)
plots_nsga2_dir = os.path.join(plots_dir, 'nsga2')
if not os.path.exists(plots_nsga2_dir):
os.makedirs(plots_nsga2_dir)
plots_features_dir = os.path.join(plots_dir, 'features')
if not os.path.exists(plots_features_dir):
os.makedirs(plots_features_dir)
datasets_dir = os.path.join(root_dir, 'datasets')
if not os.path.exists(datasets_dir):
os.makedirs(datasets_dir)
sidenum = 3 # 3 | 4 | 5 | 6
sidenum_nvar_map = {2: 6, 3: 30, 4: 108, 5: 280, 6: 600, 7: 1134, 8: 1960, 9: 3168, 10: 4860, 11: 7150, 12: 10164, 13: 14040, 14: 18928, 15: 24990, 16: 32400, 17: 41344, 18: 52020, 19: 64638, 20: 79420}
# num_vars = sidenum_nvar_map[sidenum]
# For 3x3 cantilever truss problem
n_rows = 5
n_cols = 5
num_nodes = n_rows * n_cols
num_vars = int((num_nodes * (num_nodes-1)) / 2)
print('NUMBER OF VARIABLES: ', num_vars)
time.sleep(0.5)
# num_vars = 36 # 36, 120