Struct ValidatedModelMetadata
pub struct ValidatedModelMetadata { /* private fields */ }Expand description
Validated metadata view used by the execution layer.
This type is what handwritten equation builders store after metadata has passed validation. It provides stable lookup helpers from public names to the dense indices used during execution.
Route lookups expose two different indices:
ValidatedModelMetadata::route_declaration_indexis the route position in declaration order.ValidatedRoute::input_indexis the dense execution input index for that route kind.
Implementations§
§impl ValidatedModelMetadata
impl ValidatedModelMetadata
pub fn parameters(&self) -> &[Parameter]
pub fn parameter_names(&self) -> Vec<&str>
pub fn parameter_names(&self) -> Vec<&str>
Ordered parameter names, matching the support-point vector layout.
pub fn covariates(&self) -> &[Covariate]
pub fn states(&self) -> &[State]
pub fn routes(&self) -> &[ValidatedRoute]
pub fn route_labels(&self) -> Vec<&str>
pub fn route_labels(&self) -> Vec<&str>
Declared route (input) labels, e.g. for error messages.
A label shared by a bolus and an infusion appears once.
pub fn route_input_count(&self) -> usize
pub fn route_input_count(&self) -> usize
Get the number of dense execution input slots needed for routes.
This is the maximum of the bolus-route count and infusion-route count.
pub fn outputs(&self) -> &[Output]
pub fn output_labels(&self) -> Vec<&str>
pub fn output_labels(&self) -> Vec<&str>
Declared output labels, e.g. for error messages.
pub fn particles(&self) -> Option<usize>
pub fn analytical_kernel(&self) -> Option<AnalyticalKernel>
pub fn parameter_index(&self, name: &str) -> Option<usize>
pub fn covariate_index(&self, name: &str) -> Option<usize>
pub fn state_index(&self, name: &str) -> Option<usize>
pub fn route_declaration_index(&self, name: &str) -> Option<usize>
pub fn route_declaration_index(&self, name: &str) -> Option<usize>
Look up a route by public name and return its declaration-order index.
Legacy name-only lookup: when a bolus and an infusion share a label,
this returns the first matching declaration. Prefer
Self::route_declaration_index_by_kind when the route kind is known.
pub fn route_declaration_index_by_kind(
&self,
name: &str,
kind: RouteKind,
) -> Option<usize>
pub fn route_declaration_index_by_kind( &self, name: &str, kind: RouteKind, ) -> Option<usize>
Look up a route by public name and kind, returning its declaration-order index.
pub fn route_for_label(
&self,
label: &str,
kind: RouteKind,
) -> Option<&ValidatedRoute>
pub fn route_for_label( &self, label: &str, kind: RouteKind, ) -> Option<&ValidatedRoute>
Resolve a public route label from data to a declared route of the given kind.
A bolus and an infusion may share a label (one drug given by either route), so the kind is part of the match: bolus events resolve bolus routes and infusion events resolve infusion routes.
Resolution order:
- exact route name of the given kind,
- canonical numeric alias (
input_<n>) for a bare numeric label, matching PmetricsINPUTnumbering.
A bare numeric label never falls back to a declaration position, so
"10" does not resolve unless an input_10 route is declared.
Use ValidatedRoute::input_index on the result for the dense
execution input slot.
pub fn output_for_label(&self, label: &str) -> Option<usize>
pub fn output_for_label(&self, label: &str) -> Option<usize>
Resolve a public output label from data to its dense output index.
Uses the same resolution order as Self::route_for_label: exact
output name, then the outeq_<n> alias matching Pmetrics OUTEQ
numbering, with no positional fallback.
pub fn parameter(&self, name: &str) -> Option<&Parameter>
pub fn covariate(&self, name: &str) -> Option<&Covariate>
pub fn state(&self, name: &str) -> Option<&State>
pub fn route(&self, name: &str) -> Option<&ValidatedRoute>
pub fn route(&self, name: &str) -> Option<&ValidatedRoute>
Look up a route by public name.
Legacy name-only lookup: when a bolus and an infusion share a label,
this returns the first matching declaration. Prefer Self::route_by_kind
when the route kind is known.
pub fn route_by_kind(
&self,
name: &str,
kind: RouteKind,
) -> Option<&ValidatedRoute>
pub fn route_by_kind( &self, name: &str, kind: RouteKind, ) -> Option<&ValidatedRoute>
Look up a route by public name and kind.
pub fn output(&self, name: &str) -> Option<&Output>
Trait Implementations§
§impl Clone for ValidatedModelMetadata
impl Clone for ValidatedModelMetadata
§fn clone(&self) -> ValidatedModelMetadata
fn clone(&self) -> ValidatedModelMetadata
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 ValidatedModelMetadata
impl Debug for ValidatedModelMetadata
§impl PartialEq for ValidatedModelMetadata
impl PartialEq for ValidatedModelMetadata
§fn eq(&self, other: &ValidatedModelMetadata) -> bool
fn eq(&self, other: &ValidatedModelMetadata) -> bool
self and other values to be equal, and is used by ==.impl Eq for ValidatedModelMetadata
impl StructuralPartialEq for ValidatedModelMetadata
Auto Trait Implementations§
impl Freeze for ValidatedModelMetadata
impl RefUnwindSafe for ValidatedModelMetadata
impl Send for ValidatedModelMetadata
impl Sync for ValidatedModelMetadata
impl Unpin for ValidatedModelMetadata
impl UnsafeUnpin for ValidatedModelMetadata
impl UnwindSafe for ValidatedModelMetadata
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.