Code Structure

Code Structure

Structure

cellular_raza consists of multiple crates working in tandem. It was designed to have clear separations between conceptual choices and implementation details. This approach allows us to have a greater amount of modularity and flexibility than regular simulation tools.

graph BT
    examples -.-> concepts
    examples --> core
    examples --> building_blocks
    benchmarks --> core
    benchmarks --> building_blocks
    benchmarks -.-> concepts
    core --> concepts
    building_blocks --> concepts

These crates act on varying levels of abstraction to yield a fully working numerical simulation. Since cellular_raza functions on different levels of abstraction, we try to indicate this in the table below.

crate Abstraction Level Purpose
cellular_raza - Bundle together functionality of all other crates.
concepts High Collection of (mainly) traits which need to be implemented to yield a full simulation.
core Intermediate-High Contains numerical solvers, storage handlers and more to actually solve a given system.
building_blocks Intermediate Predefined components of cell-agents and domains which can be put together to obtain a full simulation.
examples Application Showcases and introductions to different simulation approaches.
benchmarks Application Performance testing of various configurations.
flowchart LR
    High --> Intermediate --> Application

Offspring Crates & Other Contributions

During the development of cellular_raza multiple subfunctionalities which were only developed for internal use have been refactored and published as individually standing crates.

Crate Description Usage
approx-derive Derive macros for AbsDiffEq and RelativeEq of the approx crate. Testing
circ_buffer A no_std statically allocated ring-buffer with optional serde support. Save increments for a multistep solver.
uniquevec A Vec-like datastructure which only contains unique entries. It is no_std and makes no use of unsafe code. Specify multiple StorageOption in correct priority without duplicates.

Furthermore, contributions to the following projects have been made: pyo3 rust-numpy plotters servo typst

Development

Language Files Lines Blank Comment Code Complexity Bytes Uloc
Rust 112 35096 3083 5345 26668 1335 1220509 0
Python 17 2575 364 131 2080 222 86125 0
TOML 31 626 68 11 547 0 17345 0
Jupyter 2 544 0 0 544 0 50002 0
License 1 339 58 0 281 0 18092 0
SVG 3 334 0 0 334 0 28964 0
HTML 5 252 3 8 241 0 9185 0
YAML 17 216 39 7 170 0 4534 0
Markdown 11 148 25 0 123 0 9745 0
JSON 115 115 0 0 115 0 20631 0
Typst 1 67 9 0 58 0 1596 0
Shell 3 43 11 3 29 0 884 0
Autoconf 1 2 0 0 2 0 58 0
Total 319 40357 3660 5505 31192 1557 1467670 0
Estimated Cost to Develop (organic) $1,000,784
Estimated Schedule Effort (organic) 13.76 months
Estimated People Required (organic) 6.46