15 releases

0.1.6 Nov 22, 2024
0.1.5 Nov 14, 2024
0.1.3 Oct 26, 2024
0.1.0 Aug 27, 2024
0.0.5 Dec 12, 2023

#562 in Math

Download history 150/week @ 2024-08-23 44/week @ 2024-08-30 68/week @ 2024-09-06 39/week @ 2024-09-13 41/week @ 2024-09-20 34/week @ 2024-09-27 7/week @ 2024-10-04 42/week @ 2024-10-11 383/week @ 2024-10-18 607/week @ 2024-10-25 64/week @ 2024-11-01 426/week @ 2024-11-08 330/week @ 2024-11-15 398/week @ 2024-11-22 53/week @ 2024-11-29 4/week @ 2024-12-06

950 downloads per month
Used in cellular_raza

GPL-2.0 license

300KB
5.5K SLoC

cellular_raza building-blocks

This crate contains building blocks that can be combined to yield a fully working simulation.


lib.rs:

cellular_raza - Building Blocks

Building blocks allow users to quickly construct complex cellular agents. The simplest approach is to use fully-defined cell models. However, users can also build their own complex models by combining existing ones.

To create your own agent with physical mechanics and interactions, we need to include the building blocks for them as fields of our agent struct.

struct MyAgent {
    mechanics: NewtonDamped2D,
    interaction: BoundLennardJones,
}

Furthermore, we can derive desired concepts by using the CellAgent derive macro.

#[derive(CellAgent)]
struct MyAgent {
    #[Mechanics]
    mechanics: NewtonDamped2D,
    #[Interaction]
    interaction: BoundLennardJones,
}
#

For technical reasons, we are required to also once more specify the types for position, velocity and force when specifying which struct field to derive from. The optional Inf generic parameter of the Interaction trait was left out and thus defaults to (). It can and needs to also be specified when choosing interactions with non-trivial interaction information.

Optional Features

Features guard implementations which introduce additional dependencies. To simplify usability, we enable commonly used features by default.

  • pyo3 Rust bindings to the Python interpreter

Dependencies

~11–15MB
~267K SLoC