pub struct GenomeSchema {
pub fields: BTreeMap<String, FieldSchema>,
pub mutation_rates: BTreeMap<String, f64>,
}Expand description
A complete declarative description of a Genome’s structure.
Fields§
§fields: BTreeMap<String, FieldSchema>All fields in the genome, keyed by field name.
mutation_rates: BTreeMap<String, f64>Per-field mutation rates (probability that this field gets mutated per generation).
Each value must be in [0.0, 1.0] and reference a field that exists in fields.
Implementations§
Source§impl GenomeSchema
impl GenomeSchema
Sourcepub fn validate(&self) -> Result<(), SchemaError>
pub fn validate(&self) -> Result<(), SchemaError>
Validate the schema’s internal consistency.
Checks:
Float/Integerranges are not inverted (lo <= hi)Categoricalchoices andSetpools are non-empty- Every key in
mutation_ratesreferences a field that exists infields - Every value in
mutation_ratesis in[0.0, 1.0]
Trait Implementations§
Source§impl Clone for GenomeSchema
impl Clone for GenomeSchema
Source§fn clone(&self) -> GenomeSchema
fn clone(&self) -> GenomeSchema
Returns a duplicate 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 Debug for GenomeSchema
impl Debug for GenomeSchema
Source§impl<'de> Deserialize<'de> for GenomeSchema
impl<'de> Deserialize<'de> for GenomeSchema
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 PartialEq for GenomeSchema
impl PartialEq for GenomeSchema
Source§impl Serialize for GenomeSchema
impl Serialize for GenomeSchema
impl StructuralPartialEq for GenomeSchema
Auto Trait Implementations§
impl Freeze for GenomeSchema
impl RefUnwindSafe for GenomeSchema
impl Send for GenomeSchema
impl Sync for GenomeSchema
impl Unpin for GenomeSchema
impl UnsafeUnpin for GenomeSchema
impl UnwindSafe for GenomeSchema
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