-
Notifications
You must be signed in to change notification settings - Fork 0
/
script-execution.py
executable file
·38 lines (32 loc) · 1.47 KB
/
script-execution.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
35
36
37
38
import os
import subprocess
from pathlib import Path
folders = ["cases-alto-santo", "cases-limoeiro"]
algorithms = ['e']
commands = []
folders_outp = [
"results-compact",
# "results-exp-frac-cut"
#"results-exp-default-warm-s",
"results-exp-frac-cut-warm-s",
"results-mtz",
]
for direc in folders_outp:
Path(direc).mkdir(parents=True, exist_ok=True)
for f in folders:
instance = os.listdir(f)
for inst in instance:
for alg in algorithms:
#commands.append("./dparp " + f + "/" + inst + " " + "results-exp-default/" + inst + " " + alg + " 120 8000 1 0 0 0")
#commands.append("./dparp " + f + "/" + inst + " " + "results-exp-frac-cut/" + inst + " " + alg + " 120 8000 0 0 0 1")
commands.append("./dparp " + f + "/" + inst + " " + "results-compact/" + inst + " " + "c" + " 120 8000 0 0 0 1")
#commands.append("./dparp " + f + "/" + inst + " " + "results-exp-default-warm-s/" + inst + " " + alg + " 120 8000 1 0 1 0")
commands.append("./dparp " + f + "/" + inst + " " + "results-exp-frac-cut-warm-s/" + inst + " " + alg + " 120 8000 1 0 1 1")
commands.append("./dparp " + f + "/" + inst + " " + "results-mtz/" + inst + " c 120 8000 1 0 0 0")
for c in commands:
print(c)
p = subprocess.Popen(c, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
msg, err = p.communicate()
if msg:
print(msg)
print("OK!!")