-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtplp_second_round_experiment.py
More file actions
58 lines (45 loc) · 1.17 KB
/
Copy pathtplp_second_round_experiment.py
File metadata and controls
58 lines (45 loc) · 1.17 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
import sys
import os
from itertools import product
from pyrunlim import pyrunlim_launch
import pandas as pd
CONSTRAINTS = [
"response",
"precedence",
"alternate_precedence",
"alternate_response",
"chain_precedence",
"chain_response"
]
LENGTHS = [
50,
100,
250,
500,
750,
1000,
]
METHODS = [
"d4py",
"asp_native"
]
BASE_PATH = "additional_experiments"
LOG_PATH = os.path.join(BASE_PATH, "new_generation")
MODEL_PATH = os.path.join(BASE_PATH, "declare_models")
def make_command(log, model, method):
return ["python3", "conformance_checking.py", log, model, "-m", method, "-o", "/dev/null"]
rows = []
for C, L in product(CONSTRAINTS, LENGTHS):
log = f"{LOG_PATH}/{C}_{L}.xes"
model = f"{MODEL_PATH}/{C}.decl"
command = make_command(log, model, 'd4py')
p = pyrunlim_launch(command)
d4py_real = p.real
d4py_memo = p.max_memory
command = make_command(log, model, 'asp_native')
p = pyrunlim_launch(command)
asp_real = p.real
asp_memo = p.max_memory
rows.append((C, L, d4py_real, asp_real, d4py_memo, asp_memo))
df = pd.DataFrame(rows, columns=["constraint", "length", "d4py_real", "asp_real", "d4py_memo", "asp_memo"])
df.to_csv("results.csv", index=False, header=True)