sybila / biodivine-lib-param-bn

Rust library for working with parametrised Boolean networks.
MIT License
2 stars 2 forks source link

AsyncGraphEdgeParams trait for easier AsyncGraph modularisation. #6

Closed daemontus closed 3 years ago

daemontus commented 3 years ago

Introduces AsyncGraphEdgeParams as a component of the AsyncGraph. Now, the responsibility of creating a coloured (parametrised) graph is split into two:

The AsyncGraph generates the state space and possible edges (possible non-deterministic updates), implementing the Graph and InvertibleGraph traits. It then calls the AsyncGraphEdgeParams which determines the colours (parametrisations) of the actual edge.

This architecture is beneficial, because it allows tweaking the graph structure without unnecessarily re-implementing the explicit state space of the non-deterministic graph. It even allows for nested (delegated) implementations of AsyncGraphEdgeParams where the DefaultEdgeParams are used as a basis for further filtering or restriction of the graph.

Note that this does not meaningfully change any existing public API of the crate (it add a reference to the signature of AsyncGraph::empty_params to match AsyncGraph::unit_params), but it adds a few new methods (aside from AsyncGraphEdgeParams and DefaultEdgeParams obviously).

codecov[bot] commented 3 years ago

Codecov Report

Merging #6 into master will decrease coverage by 0.83%. The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #6      +/-   ##
==========================================
- Coverage   85.00%   84.17%   -0.84%     
==========================================
  Files          28       29       +1     
  Lines        1761     1750      -11     
==========================================
- Hits         1497     1473      -24     
- Misses        264      277      +13     
Impacted Files Coverage Δ
src/async_graph/mod.rs 100.00% <ø> (ø)
src/impl_variable_id.rs 0.00% <ø> (ø)
src/async_graph/impl_async_graph.rs 72.00% <66.66%> (-16.24%) :arrow_down:
src/async_graph/impl_default_edge_params.rs 85.18% <85.18%> (ø)
src/async_graph/impl_evolution_operators.rs 91.66% <100.00%> (ø)
src/impl_fn_update.rs 87.50% <0.00%> (-6.25%) :arrow_down:
src/impl_regulatory_graph.rs 84.90% <0.00%> (-1.89%) :arrow_down:
src/bdd_params/impl_witness_generator.rs 81.08% <0.00%> (-1.81%) :arrow_down:
src/sbml/mod.rs 70.14% <0.00%> (-0.69%) :arrow_down:
src/bdd_params/impl_bdd_parameter_encoder.rs 85.45% <0.00%> (-0.61%) :arrow_down:
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e1a10e1...3b151ba. Read the comment docs.