-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,4 @@ Cargo.lock | |
|
||
.idea | ||
|
||
/data/large | ||
/data/faulty |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import os | ||
import re | ||
import csv | ||
|
||
""" | ||
A simple script that will take data from results-fwd-test and make a nicer CSV summary | ||
that reflects how many BDD nodes were used in each iteration of the reachability benchmark. | ||
""" | ||
|
||
if not os.path.exists('./results-fwd-summarised'): | ||
os.makedirs('./results-fwd-summarised') | ||
|
||
for result_file in os.listdir('./results-fwd-test'): | ||
if not result_file.endswith('.txt'): | ||
continue | ||
with open(f"./results-fwd-test/{result_file}") as file: | ||
print(f"Loaded result file: {result_file}") | ||
step = 0 | ||
completed_iterations = 0 | ||
accumulated = [] | ||
max_bdd_size = [0,0,0,0] | ||
for line in file: | ||
if line.startswith('Completed one wave'): | ||
# Restart once new wave is found. | ||
step = 0 | ||
completed_iterations += 1 | ||
continue | ||
|
||
step_line = re.match(" \\> BDD sizes\\: Some\\((\d+)\\) Some\\((\d+)\\) Some\\((\d+)\\) Some\\((\d+)\\)", line) | ||
if step_line is not None: | ||
# Found one step line. | ||
if len(accumulated) <= step: | ||
# reached_by, size_1, .. size_4 | ||
accumulated.append([0,0,0,0,0]) | ||
line_sizes = [int(step_line[i + 1]) for i in range(4)] | ||
max_bdd_size = [max(max_bdd_size[i], line_sizes[i]) for i in range(4)] | ||
accumulated[step][0] += 1 | ||
accumulated[step][1] += line_sizes[0] | ||
accumulated[step][2] += line_sizes[1] | ||
accumulated[step][3] += line_sizes[2] | ||
accumulated[step][4] += line_sizes[3] | ||
step += 1 | ||
print(f" >> Fully completed iterations: {completed_iterations}") | ||
print(f" >> Max. iterations lnegth: {len(accumulated)}") | ||
print(f" >> Max. BDD size: {max_bdd_size}") | ||
with open(f"./results-fwd-summarised/{result_file.replace('.txt', '.csv')}", 'w') as outfile: | ||
writer = csv.writer(outfile) | ||
writer.writerow(['iteration', 'unary', 'binary', 'gray', 'petri']) | ||
for row in accumulated: | ||
writer.writerow(row) |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
use biodivine_lib_logical_models::{BinaryIntegerDomain, GrayCodeIntegerDomain, PetriNetIntegerDomain, reachability_benchmark, UnaryIntegerDomain}; | ||
use biodivine_lib_logical_models::benchmarks::reachability::reachability_benchmark; | ||
// use biodivine_lib_logical_models::prelude::old_symbolic_domain::{ | ||
// BinaryIntegerDomain, GrayCodeIntegerDomain, PetriNetIntegerDomain, UnaryIntegerDomain, | ||
// }; | ||
|
||
use biodivine_lib_logical_models::prelude::symbolic_domain::{ | ||
BinaryIntegerDomain, GrayCodeIntegerDomain, PetriNetIntegerDomain, UnaryIntegerDomain, | ||
}; | ||
|
||
fn main() { | ||
let args = std::env::args().collect::<Vec<_>>(); | ||
let representation = args[1].clone(); | ||
let sbml_path = args[2].clone(); | ||
|
||
let now = std::time::Instant::now(); | ||
|
||
match representation.as_str() { | ||
"unary" => reachability_benchmark::<UnaryIntegerDomain>(sbml_path.as_str()), | ||
"binary" => reachability_benchmark::<BinaryIntegerDomain<u8>>(sbml_path.as_str()), | ||
"petri_net" => reachability_benchmark::<PetriNetIntegerDomain>(sbml_path.as_str()), | ||
"gray" | "grey" => reachability_benchmark::<GrayCodeIntegerDomain<u8>>(sbml_path.as_str()), | ||
_ => panic!("Unknown representation: {}.", representation), | ||
} | ||
} | ||
|
||
println!("Time: {}s", now.elapsed().as_secs()); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use biodivine_lib_logical_models::{ | ||
benchmarks::rewritten_reachability::reachability_benchmark, | ||
prelude::symbolic_domain::{ | ||
BinaryIntegerDomain, GrayCodeIntegerDomain, PetriNetIntegerDomain, UnaryIntegerDomain, | ||
}, | ||
}; | ||
// use biodivine_lib_logical_models::prelude::old_symbolic_domain::{ | ||
// BinaryIntegerDomain, GrayCodeIntegerDomain, PetriNetIntegerDomain, UnaryIntegerDomain, | ||
// }; | ||
|
||
fn main() { | ||
let args = std::env::args().collect::<Vec<_>>(); | ||
let representation = args[1].clone(); | ||
let sbml_path = args[2].clone(); | ||
|
||
let now = std::time::Instant::now(); | ||
|
||
match representation.as_str() { | ||
"unary" => reachability_benchmark::<UnaryIntegerDomain>(sbml_path.as_str()), | ||
"binary" => reachability_benchmark::<BinaryIntegerDomain<u8>>(sbml_path.as_str()), | ||
"petri_net" => reachability_benchmark::<PetriNetIntegerDomain>(sbml_path.as_str()), | ||
"gray" | "grey" => reachability_benchmark::<GrayCodeIntegerDomain<u8>>(sbml_path.as_str()), | ||
_ => panic!("Unknown representation: {}.", representation), | ||
} | ||
|
||
println!("Time: {}s", now.elapsed().as_secs()); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod reachability; | ||
pub mod rewritten_reachability; |