-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_a_scripts.py
More file actions
27 lines (23 loc) · 1.21 KB
/
create_a_scripts.py
File metadata and controls
27 lines (23 loc) · 1.21 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
import os
def generate_a_scripts(base_path, out_path, feature_model_path, sampling):
if not os.path.exists(out_path):
os.makedirs(out_path)
for folder in os.listdir(base_path):
if folder not in ['Scripts', 'ExperimentsUtil']:
for sub_folder in os.listdir(base_path + os.sep + folder):
relative_path = "../" + folder + "/" + sub_folder
script_name = folder + "_" + sub_folder + ".a"
write_a_file(relative_path, out_path, feature_model_path, script_name, sampling)
def write_a_file(relativePath, out_path, feature_model_path, script_name, sampling):
lines = ["log " + relativePath + "/log.txt\n",
"vm " + feature_model_path + "\n",
"all " + relativePath + "/measurements.xml\n",
"mlsettings learn_logFunction:true stopOnLongRound:false\n",
"abortError 0.1\n"
"nfp Performance\n",
sampling + "\n",
"learn-splconqueror\n",
"analyze-learning\n"
"predict-configs-splconqueror\n",
"measurementstocsv " + relativePath + "/SPLConquerorMeasurements.csv\n"]
open(out_path + os.sep + script_name, "w").writelines(lines)