Struct ModelMetadata
pub struct ModelMetadata { /* private fields */ }Expand description
Builder for handwritten model metadata.
Use ModelMetadata to declare the public names that should be attached to
a handwritten equation. After validation, the resulting metadata can be
attached to handwritten crate::ODE, crate::Analytical, and
crate::SDE models through their with_metadata(...) methods.
Implementations§
§impl ModelMetadata
impl ModelMetadata
pub fn new(name: impl Into<String>) -> ModelMetadata
pub fn new(name: impl Into<String>) -> ModelMetadata
Create a new metadata builder with a model name.
pub fn kind(self, kind: ModelKind) -> ModelMetadata
pub fn kind(self, kind: ModelKind) -> ModelMetadata
Set the model kind explicitly.
pub fn parameters<I, S>(self, parameters: I) -> ModelMetadata
pub fn parameters<I, S>(self, parameters: I) -> ModelMetadata
Replace the ordered parameter list.
pub fn covariates<I>(self, covariates: I) -> ModelMetadatawhere
I: IntoIterator<Item = Covariate>,
pub fn covariates<I>(self, covariates: I) -> ModelMetadatawhere
I: IntoIterator<Item = Covariate>,
Replace the ordered covariate list.
pub fn states<I, S>(self, states: I) -> ModelMetadata
pub fn states<I, S>(self, states: I) -> ModelMetadata
Replace the ordered state list.
pub fn route(self, route: Route) -> ModelMetadata
pub fn route(self, route: Route) -> ModelMetadata
Add one route declaration.
pub fn routes<I>(self, routes: I) -> ModelMetadatawhere
I: IntoIterator<Item = Route>,
pub fn routes<I>(self, routes: I) -> ModelMetadatawhere
I: IntoIterator<Item = Route>,
Extend with multiple route declarations.
pub fn outputs<I, S>(self, outputs: I) -> ModelMetadata
pub fn outputs<I, S>(self, outputs: I) -> ModelMetadata
Replace the ordered output list.
pub fn particles(self, particles: usize) -> ModelMetadata
pub fn particles(self, particles: usize) -> ModelMetadata
Set the particle count for stochastic models.
pub fn analytical_kernel(self, analytical: AnalyticalKernel) -> ModelMetadata
pub fn analytical_kernel(self, analytical: AnalyticalKernel) -> ModelMetadata
Set the analytical kernel identity for built-in analytical models.
pub fn parameters_decl(&self) -> &[Parameter]
pub fn parameters_decl(&self) -> &[Parameter]
Get the ordered parameter metadata.
pub fn covariates_decl(&self) -> &[Covariate]
pub fn covariates_decl(&self) -> &[Covariate]
Get the ordered covariate metadata.
pub fn states_decl(&self) -> &[State]
pub fn states_decl(&self) -> &[State]
Get the ordered state metadata.
pub fn routes_decl(&self) -> &[Route]
pub fn routes_decl(&self) -> &[Route]
Get the ordered route metadata.
pub fn outputs_decl(&self) -> &[Output]
pub fn outputs_decl(&self) -> &[Output]
Get the ordered output metadata.
pub fn particles_decl(&self) -> Option<usize>
pub fn particles_decl(&self) -> Option<usize>
Get the declared particle count.
pub fn analytical_kernel_decl(&self) -> Option<AnalyticalKernel>
pub fn analytical_kernel_decl(&self) -> Option<AnalyticalKernel>
Get the declared analytical kernel identity.
pub fn validate(self) -> Result<ValidatedModelMetadata, ModelMetadataError>
pub fn validate(self) -> Result<ValidatedModelMetadata, ModelMetadataError>
Validate this metadata using its declared kind.
Use this when the metadata itself already declares whether the model is ODE, analytical, or SDE.
pub fn validate_for(
self,
kind: ModelKind,
) -> Result<ValidatedModelMetadata, ModelMetadataError>
pub fn validate_for( self, kind: ModelKind, ) -> Result<ValidatedModelMetadata, ModelMetadataError>
Validate this metadata for a specific model kind.
Use this when the equation type determines the model family and you want validation to enforce that family explicitly.
pub fn validate_for_with_particles(
self,
kind: ModelKind,
fallback_particles: usize,
) -> Result<ValidatedModelMetadata, ModelMetadataError>
pub fn validate_for_with_particles( self, kind: ModelKind, fallback_particles: usize, ) -> Result<ValidatedModelMetadata, ModelMetadataError>
Validate this metadata for a specific model kind, using a fallback particle count when the metadata itself does not declare one.
Trait Implementations§
§impl Clone for ModelMetadata
impl Clone for ModelMetadata
§fn clone(&self) -> ModelMetadata
fn clone(&self) -> ModelMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ModelMetadata
impl Debug for ModelMetadata
§impl PartialEq for ModelMetadata
impl PartialEq for ModelMetadata
impl Eq for ModelMetadata
impl StructuralPartialEq for ModelMetadata
Auto Trait Implementations§
impl Freeze for ModelMetadata
impl RefUnwindSafe for ModelMetadata
impl Send for ModelMetadata
impl Sync for ModelMetadata
impl Unpin for ModelMetadata
impl UnsafeUnpin for ModelMetadata
impl UnwindSafe for ModelMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.