Commit 6b592c87 authored by Jaime Arias's avatar Jaime Arias
Browse files

update csv generator with explored states

parent 9357e98c
No preview for this file type
......@@ -19,14 +19,13 @@ def get_time(experiment, tool):
Returns
-------
time : int or None
elapse time of the experiment
truthy : str or None
True if property is satisfied, False otherwise
dict of str
Dictionary with collected data
"""
regex_true = r''
regex_false = r''
regex_time = r''
regex_explored = re.compile(r'Explored (\d+) states')
filename = ""
name, extension = os.path.splitext(experiment)
......@@ -53,6 +52,7 @@ def get_time(experiment, tool):
match_true = regex_true.search(file_content)
match_false = regex_false.search(file_content)
match_time = regex_time.search(file_content)
match_explored = regex_explored.search(file_content)
# property verification
verification = None
......@@ -67,7 +67,16 @@ def get_time(experiment, tool):
time = float(match_time.group(1))
time_s = time / 1000. if (tool == 'pmc-sog') else time
return (time_s, verification)
# get explored states
explored_states = match_explored.group(1) if match_explored else None
output = {
"elapsed_time": time_s,
"property_check": verification,
"explored_states": explored_states
}
return output
def check_error(experiment):
......@@ -109,7 +118,8 @@ def get_data(experiments):
-------
list of dict
List of dictionaries with keys: "model", "tool", "strategy",
"num_nodes", "num_threads", "formula", "time", "property", and "error"
"num_nodes", "num_threads", "formula", "time", "property",
"explored_states", and "error"
"""
results = []
......@@ -123,7 +133,9 @@ def get_data(experiments):
num_nodes, num_threads, formula = regex.findall(out_file)[0]
elapsed_time, property_check = get_time(experiment, tool)
data = get_time(experiment, tool)
elapsed_time, property_check, explored_states = map(
data.get, ('elapsed_time', 'property_check', 'explored_states'))
error = "OK"
if ((elapsed_time is None) and (property_check is None)):
......@@ -138,6 +150,7 @@ def get_data(experiments):
"num_threads": int(num_threads),
"time": elapsed_time,
"property": property_check,
"explored_states": explored_states,
"error": error
})
......@@ -186,7 +199,7 @@ if __name__ == '__main__':
# structure of the csv file
CSV_FIELDNAMES = [
'model', 'formula', 'tool', 'strategy', 'num_nodes', 'num_threads',
'time', 'property', 'error'
'time', 'property', 'explored_states', 'error'
]
# experiments' results
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment