cellular_raza_concepts

Struct CellAgentBox

Source
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>

Source

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>

Source

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>

Source§

fn clone(&self) -> CellAgentBox<Cel>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Cel: Debug> Debug for CellAgentBox<Cel>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Cel> Id for CellAgentBox<Cel>

Source§

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

Retrieves the Identifier from the object.
Source§

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>
where A: Interaction<Pos, Vel, For, Inf> + Serialize + for<'a> Deserialize<'a>,

Source§

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>

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>

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>

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>,

Source§

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>

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>

Source§

fn eq(&self, other: &CellAgentBox<Cel>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Cel> PlotSelf for CellAgentBox<Cel>
where Cel: PlotSelf + Serialize + for<'a> Deserialize<'a>,

Source§

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>

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>

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>,

Source§

fn pos(&self) -> Pos

Gets the cells current position.
Source§

fn set_pos(&mut self, pos: &Pos)

Gets the cells current velocity.
Source§

impl<Cel> Serialize for CellAgentBox<Cel>
where Cel: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<A, Vel> Velocity<Vel> for CellAgentBox<A>
where A: Velocity<Vel>,

Source§

fn velocity(&self) -> Vel

Gets the cells current velocity.
Source§

fn set_velocity(&mut self, velocity: &Vel)

Sets the cells current velocity.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,