pub struct CellAgentBox<Cel> {
pub cell: Cel,
/* private fields */
}
Expand description
A container struct containing meta-information of a given Cell Some variables such as id are not required and not desired to be initialized by the user. This CellAgentBox acts as a container around the cell to hold these variables.
Fields§
§cell: Cel
The user-defined cell which is stored inside this container.
Implementations§
Source§impl<Cel> CellAgentBox<Cel>
impl<Cel> CellAgentBox<Cel>
Sourcepub fn get_parent_id(&self) -> Option<CellularIdentifier>
pub fn get_parent_id(&self) -> Option<CellularIdentifier>
Simple method to retrieve the CellularIdentifier of the parent cell if existing.
Source§impl<Cel> CellAgentBox<Cel>
impl<Cel> CellAgentBox<Cel>
Sourcepub fn new(
voxel_index: u64,
n_cell: u64,
cell: Cel,
parent_id: Option<CellularIdentifier>,
) -> CellAgentBox<Cel>
pub fn new( voxel_index: u64, n_cell: u64, cell: Cel, parent_id: Option<CellularIdentifier>, ) -> CellAgentBox<Cel>
Create a new CellAgentBox at a specific voxel with a voxel-unique number of cells that has already been created at this position.
Trait Implementations§
Source§impl<Cel: Clone> Clone for CellAgentBox<Cel>
impl<Cel: Clone> Clone for CellAgentBox<Cel>
Source§fn clone(&self) -> CellAgentBox<Cel>
fn clone(&self) -> CellAgentBox<Cel>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Cel: Debug> Debug for CellAgentBox<Cel>
impl<Cel: Debug> Debug for CellAgentBox<Cel>
Source§impl<'de, Cel> Deserialize<'de> for CellAgentBox<Cel>where
Cel: Deserialize<'de>,
impl<'de, Cel> Deserialize<'de> for CellAgentBox<Cel>where
Cel: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Cel> Id for CellAgentBox<Cel>
impl<Cel> Id for CellAgentBox<Cel>
Source§type Identifier = (u64, u64)
type Identifier = (u64, u64)
The identifier type is usually chosen to be completely unique and repeatable across
different simulations.
Source§fn get_id(&self) -> CellularIdentifier
fn get_id(&self) -> CellularIdentifier
Retrieves the Identifier from the object.
Source§fn ref_id(&self) -> &CellularIdentifier
fn ref_id(&self) -> &CellularIdentifier
Returns a reference to the id of the object.
Source§impl<Pos, Vel, For, Inf, A> Interaction<Pos, Vel, For, Inf> for CellAgentBox<A>
impl<Pos, Vel, For, Inf, A> Interaction<Pos, Vel, For, Inf> for CellAgentBox<A>
Source§fn get_interaction_information(&self) -> Inf
fn get_interaction_information(&self) -> Inf
Get additional information of cellular properties (ie. for cell-specific interactions).
For now, this can also be used to get the mass of the other cell-agent.
In the future, we will probably provide a custom function for this.
Source§fn calculate_force_between(
&self,
own_pos: &Pos,
own_vel: &Vel,
ext_pos: &Pos,
ext_vel: &Vel,
ext_information: &Inf,
) -> Result<(For, For), CalcError>
fn calculate_force_between( &self, own_pos: &Pos, own_vel: &Vel, ext_pos: &Pos, ext_vel: &Vel, ext_information: &Inf, ) -> Result<(For, For), CalcError>
Calculates the forces (velocity-derivative) on the corresponding external position given
external velocity.
By providing velocities, we can calculate terms that are related to friction.
The function returns two forces, one acting on the current agent and the other on the
external agent.
Source§fn is_neighbor(
&self,
own_pos: &Pos,
ext_pos: &Pos,
ext_inf: &Inf,
) -> Result<bool, CalcError>
fn is_neighbor( &self, own_pos: &Pos, ext_pos: &Pos, ext_inf: &Inf, ) -> Result<bool, CalcError>
Checks if the other cell represented by position and information is a neighbor to the current one or not.
Source§fn react_to_neighbors(&mut self, neighbors: usize) -> Result<(), CalcError>
fn react_to_neighbors(&mut self, neighbors: usize) -> Result<(), CalcError>
Reacts to the results gathered by the Interaction::is_neighbor
method and changes the state of the cell.
Source§impl<Pos, Vel, For, Float, A> Mechanics<Pos, Vel, For, Float> for CellAgentBox<A>where
A: Mechanics<Pos, Vel, For, Float>,
impl<Pos, Vel, For, Float, A> Mechanics<Pos, Vel, For, Float> for CellAgentBox<A>where
A: Mechanics<Pos, Vel, For, Float>,
Source§fn get_random_contribution(
&self,
rng: &mut ChaCha8Rng,
dt: Float,
) -> Result<(Pos, Vel), RngError>
fn get_random_contribution( &self, rng: &mut ChaCha8Rng, dt: Float, ) -> Result<(Pos, Vel), RngError>
Define a new random variable in case that the mechanics type contains a random aspect to
its motion.
By default this function does nothing.
Source§fn calculate_increment(&self, force: For) -> Result<(Pos, Vel), CalcError>
fn calculate_increment(&self, force: For) -> Result<(Pos, Vel), CalcError>
Calculate the time-derivative of force and velocity given all the forces that act on the
cell.
Simple damping effects should be included in this trait if not explicitly given by the
SubDomainForce trait.
Source§impl<Cel: PartialEq> PartialEq for CellAgentBox<Cel>
impl<Cel: PartialEq> PartialEq for CellAgentBox<Cel>
Source§impl<Cel> PlotSelf for CellAgentBox<Cel>
impl<Cel> PlotSelf for CellAgentBox<Cel>
Source§fn plot_self<Db>(
&self,
root: &mut DrawingArea<Db, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
) -> Result<(), DrawingError>where
Db: DrawingBackend,
fn plot_self<Db>(
&self,
root: &mut DrawingArea<Db, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
) -> Result<(), DrawingError>where
Db: DrawingBackend,
Define which elements to draw when plotting the element itself.
Source§fn plot_self_bitmap(
&self,
root: &mut DrawingArea<BitMapBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
) -> Result<(), DrawingError>
fn plot_self_bitmap( &self, root: &mut DrawingArea<BitMapBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>, ) -> Result<(), DrawingError>
Overload for backend to have a purely bitmap function.
User are not expected to change this function.
Source§fn plot_self_svg(
&self,
root: &mut DrawingArea<SVGBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
) -> Result<(), DrawingError>
fn plot_self_svg( &self, root: &mut DrawingArea<SVGBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>, ) -> Result<(), DrawingError>
Overload for backend to have a purely bitmap function.
User are not expected to change this function.
Source§impl<A, Pos> Position<Pos> for CellAgentBox<A>where
A: Position<Pos>,
impl<A, Pos> Position<Pos> for CellAgentBox<A>where
A: Position<Pos>,
Source§impl<Cel> Serialize for CellAgentBox<Cel>where
Cel: Serialize,
impl<Cel> Serialize for CellAgentBox<Cel>where
Cel: Serialize,
Source§impl<A, Vel> Velocity<Vel> for CellAgentBox<A>where
A: Velocity<Vel>,
impl<A, Vel> Velocity<Vel> for CellAgentBox<A>where
A: Velocity<Vel>,
impl<Cel> StructuralPartialEq for CellAgentBox<Cel>
Auto Trait Implementations§
impl<Cel> Freeze for CellAgentBox<Cel>where
Cel: Freeze,
impl<Cel> RefUnwindSafe for CellAgentBox<Cel>where
Cel: RefUnwindSafe,
impl<Cel> Send for CellAgentBox<Cel>where
Cel: Send,
impl<Cel> Sync for CellAgentBox<Cel>where
Cel: Sync,
impl<Cel> Unpin for CellAgentBox<Cel>where
Cel: Unpin,
impl<Cel> UnwindSafe for CellAgentBox<Cel>where
Cel: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)