{
fn get_intracellular(&self) -> CI;
fn set_intracellular(&mut self, concentration_vector: CI);
fn calculate_intra_and_extracellular_reaction_increment(
&self,
internal_concentration_vector: &CI,
external_concentration_vector: &CE
) -> Result<(CI, CE), CalcError>;
}
```
| Name | Equations |
| --- | --- |
| `BacteriaReactions` | $\dot{V_c} = \frac{u}{1+\nu_I [I]} \sigma [R]V_c$
$\dot{[R]} = \sum\limits_c -\frac{u}{1+\nu_I [I]} \frac{V_c}{V_D} [R] \delta(x-x_c) + D_R\Delta [R]$
$\dot{[I]} = \sum\limits_c b\frac{V_c}{V_D}\delta(x-x_c) + D_I\Delta [I]$ |
| `NoReactions` | |
---
## Cycle
```rust
pub trait Cycle {
fn update_cycle(
rng: &mut ChaCha8Rng,
dt: &Float,
cell: &mut Cell
) -> Option;
fn divide(
rng: &mut ChaCha8Rng,
cell: &mut Cell
) -> Result\;
```
```rust
// Default method
// Can be overwritten
fn update_conditional_phased_death(
rng: &mut ChaCha8Rng,
dt: &Float,
cell: &mut Cell
) -> Result {
Ok(true)
}
}
```
| |
Usually implemented individually for every new Cell-Agent.
### Example
```rust
impl Cycle for Cell {
fn update_cycle(rng: &mut ChaCha8Rng, dt: &f64, cell: &mut Cell) -> Option {
// Increase the current age of the cell
cell.current_age += dt;
// If the cell is older than the current age, return a division event
if cell.current_age > cell.maximum_age {
return Some(CycleEvent::Division)
}
None
}
// ...
}
```
|
---
## Physical Domain
#### Domain
#### Subdomain
```rust
pub trait Domain {
type SubDomainIndex;
type VoxelIndex;
fn get_all_voxel_indices(
&self
) -> Vec;
```
```rust
pub trait SubDomain {
type VoxelIndex;
fn get_voxel_index_of(
&self,
cell: &C
) -> Result;
```
```rust
fn decompose(
self,
n_subdomains: NonZeroUsize,
cells: Vec
) -> Result<
DecomposedDomain,
DecomposeError
>
where S: SubDomain;
}
```
```rust
fn get_neighbor_voxel_indices(
&self,
voxel_index: &Self::VoxelIndex
) -> Vec;
fn apply_boundary(
&self,
cell: &mut C
) -> Result<(), BoundaryError>;
fn get_all_indices(
&self
) -> Vec;
}
```
| Name | Dim | Description |
| --- |:---:| --- |
| `CartesianCuboid` | 1, 2, 3 | Cuboid $[a_0, b_0] \times \dots \times [a_d, b_d] \sub \mathbb{R}^d$
with reflective boundary conditions. |
---
## Techniques
- Domain decomposition
- Split simulation domain into multiple subdomains
- Execute upate steps in parallel
- Possible due to locality of interactions
- Storage Manager
- Export parts or store complete simulation
- xml, json or sled (embedded) database
---
## Features
- Fine-grained control over parameters
- Combine building-blocks to new Agents
- Multiple backends possible
- Clear separatin between concepts and Implementation
- Defines "Language of ABMs"