feat irace add script to parse irace to csv

This commit is contained in:
Johann Dreo 2021-01-25 13:48:52 +01:00
commit e617916e98
2 changed files with 20 additions and 2 deletions

View file

@ -62,8 +62,8 @@ targetRunner = "./target-runner"
## Maximum number of runs (invocations of targetRunner) that will be
## performed. It determines the maximum budget of experiments for the
## tuning.
maxExperiments = 100000
## tuning. (minimum: 180)
maxExperiments = 20000 # 100000
## Maximum total execution time in seconds for the executions of
## targetRunner. targetRunner must return two values: cost and time.

View file

@ -0,0 +1,18 @@
#!/usr/bin/env python3
import os
import re
import sys
print("pb,ecdf,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement")
for datadir in sys.argv[1:]:
for pb_dir in os.listdir(datadir):
if "results_problem" in pb_dir:
pb_id=pb_dir.replace("results_problem_","")
with open(os.path.join("./",datadir,pb_dir,"irace.log")) as fd:
data = [line.strip() for line in fd.readlines() if "--crossover-rate=" in line]
for line in data:
algo=re.sub("\-\-\S*=", ",", line)
csv_line=pb_id+","+algo
print(csv_line.replace(" ",""))