Skip to main content

MorphogenSystem

Struct MorphogenSystem 

Source
pub struct MorphogenSystem {
    pub max_nodes: usize,
    pub active: Vec<bool>,
    pub u: Vec<f64>,
    pub v: Vec<f64>,
    pub adj: Vec<Vec<f64>>,
    pub d_u: f64,
    pub d_v: f64,
    pub a: f64,
    pub b: f64,
    pub c: f64,
    pub d: f64,
}

Fields§

§max_nodes: usize§active: Vec<bool>§u: Vec<f64>§v: Vec<f64>§adj: Vec<Vec<f64>>§d_u: f64§d_v: f64§a: f64§b: f64§c: f64§d: f64

Implementations§

Source§

impl MorphogenSystem

Source

pub fn new(max_nodes: usize, d_u: f64, d_v: f64) -> Self

Source

pub fn activate_node(&mut self, idx: usize, u_init: f64, v_init: f64)

Source

pub fn set_edge(&mut self, u_idx: usize, v_idx: usize, weight: f64)

Source

pub fn get_cfl_dt(&self, requested_dt: f64) -> f64

Source

pub fn compute_derivatives( &self, u_state: &[f64], v_state: &[f64], du: &mut [f64], dv: &mut [f64], )

Source

pub fn step_rk4(&mut self, requested_dt: f64)

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.