1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
use crateCalcError;
/// Defines how the cell uses the extracellular gradient.
///
/// This trait can also be derived with the [CellAgent](crate::CellAgent) derive macro.
/// ```
/// use cellular_raza_concepts::{reactions_old::InteractionExtracellularGradient,
/// CalcError, CellAgent
/// };
///
/// struct DoNothingGradient;
///
/// impl<C, G> InteractionExtracellularGradient<C, G> for DoNothingGradient {
/// fn sense_gradient(
/// cell: &mut C,
/// gradient: &G,
/// ) -> Result<(), CalcError> {
/// Ok(())
/// }
/// }
///
/// #[derive(CellAgent)]
/// struct MyAgent {
/// #[ExtracellularGradient]
/// gradient: DoNothingGradient,
/// }
/// ```
/// Specify how cellular reactions are taking place.
///
/// This trait can also be derived with the [CellAgent](crate::CellAgent) derive macro.
/// ```
/// use cellular_raza_concepts::{reactions_old::CellularReactions, CellAgent, CalcError};
/// struct MyReactions {
/// intracellular: f64,
/// half_time: f64,
/// }
///
/// impl CellularReactions<f64> for MyReactions {
/// fn get_intracellular(&self) -> f64 {
/// self.intracellular
/// }
///
/// fn set_intracellular(&mut self, intracellular: f64) {
/// self.intracellular = intracellular;
/// }
///
/// fn calculate_intra_and_extracellular_reaction_increment(
/// &self,
/// internal_concentration_vector: &f64,
/// external_concentration_vector: &f64,
/// ) -> Result<(f64, f64), CalcError> {
/// Ok((-self.half_time * self.intracellular, self.half_time * self.intracellular))
/// }
/// }
// #[derive(CellAgent)]
// struct MyAgent {
// #[Reactions]
// reactions: MyReactions,
// }
/// ```
/// Obtain the current volume of the cell
///
/// This trait is used when updating extracellular reactions and processes.
/// For more details see [domain](crate::Domain).