pub struct Blueprint {Show 15 fields
pub name: String,
pub width: usize,
pub height: usize,
pub depth: usize,
pub types: Vec<TypeSpec>,
pub fields: Vec<SpeciesSpec>,
pub adhesion: Option<Adhesion>,
pub contact: Vec<f64>,
pub temperature: f64,
pub neighbour_order: u8,
pub seed: u64,
pub steps: u64,
pub dump_every: u64,
pub initial: Initial,
pub units: Units,
}Expand description
The whole description.
Fields§
§name: StringA name for the model.
width: usizeLattice width in sites.
height: usizeLattice height in sites.
depth: usizeLattice depth in sites. Absent is a plane.
types: Vec<TypeSpec>Cell types beside the medium, in order.
fields: Vec<SpeciesSpec>Diffusing species, in order.
adhesion: Option<Adhesion>Adhesion molecules and their binding matrix, absent when the contact matrix says everything.
contact: Vec<f64>Contact energies over ["Medium", types...], row-major and symmetric.
temperature: f64Metropolis fluctuation amplitude.
neighbour_order: u81 for four neighbours, 2 for eight.
seed: u64Random seed.
steps: u64Monte Carlo steps to run.
dump_every: u64Steps between label-field dumps.
initial: InitialThe initial condition.
units: UnitsThe physical scale.
Implementations§
Source§impl Blueprint
impl Blueprint
Sourcepub fn effective_contact(&self) -> Vec<f64>
pub fn effective_contact(&self) -> Vec<f64>
The contact matrix with the adhesion molecules folded in.
Binding lowers the energy of a bond, so what two types’ molecules bind comes off the contact energy the description states between them.
Sourcepub fn initial_types(&self, cells: usize) -> Vec<u8> ⓘ
pub fn initial_types(&self, cells: usize) -> Vec<u8> ⓘ
Type index of each cell at the start, by the fractions stated.
Assignment walks the cells in order and hands out each type its share, so the same description and the same cell count always start the same way whatever an engine’s own random stream does.
Sourcepub fn from_json(text: &str) -> Result<Blueprint, String>
pub fn from_json(text: &str) -> Result<Blueprint, String>
Read a description from JSON.
§Errors
A message naming the parse failure or the inconsistency found. A secretion or uptake entry naming a species the description does not state is an error rather than a silent zero, since a typo there would otherwise read as a cell that secretes nothing.