🎱 Interaction
The Interaction
trait is responsible for
modeling physical interactions between cellular agents.
It can also be used to detect and react to neighbors.
The calculate_force_between
method calculates forces acting on the two cells in question which
will then later be used to update the position and velocity via the
mechanics concept.
We can also exchange information between the cells which is not related to their position or
velocity via the get_interaction_information
method.
pub trait Interaction<Pos, Vel, Force, Inf = ()> {
fn get_interaction_information(&self) -> Inf;
fn calculate_force_between(
&self,
own_pos: &Pos,
own_vel: &Vel,
ext_pos: &Pos,
ext_vel: &Vel,
ext_info: &Inf
) -> Result<(Force, Force), CalcError>;
Furthermore, to model reactions to neighbors, the trait provides the is_neighbor
and
react_to_neighbors
methods which are used to first count the number of neighbors and then
react accordingly.
// Provided methods
fn is_neighbor(
&self,
own_pos: &Pos,
ext_pos: &Pos,
ext_inf: &Inf
) -> Result<bool, CalcError> {
Ok(false)
}
fn react_to_neighbors(&mut self, neighbors: usize) -> Result<(), CalcError> {Ok(())}
}
Their default functionality is to never count and do no interactions.
Examples
When representing cells as point-like particles, we can employ classical interactions given by
interaction potentials such as the
MorsePotential
,
MiePotential
or
BoundLennardJones
potential.
Other examples of complex interactions between cells are
- Semi-Vertex cells
- Bacterial Rods