Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMC-SOG
experiments
hybrid
Commits
6b592c87
Commit
6b592c87
authored
May 27, 2020
by
Jaime Arias
Browse files
update csv generator with explored states
parent
9357e98c
Changes
2
Hide whitespace changes
Inline
Side-by-side
results/pmc-sog.zip
View file @
6b592c87
No preview for this file type
scripts/csv_generator.py
View file @
6b592c87
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment