Skip to main content

ServiceComplianceNode

Struct ServiceComplianceNode 

Source
pub struct ServiceComplianceNode {
    pub node_index: usize,
    pub sample_count: usize,
    pub within_limits_count: usize,
    pub below_min_count: usize,
    pub above_max_count: usize,
    pub longest_violation_streak: usize,
    pub pressure_deficit_integral: f64,
    pub pressure_excess_integral: f64,
    pub worst_below_min: f64,
    pub worst_above_max: f64,
}
Expand description

Per-node service-compliance metrics for a single simulation run.

Fields§

§node_index: usize

Zero-based index of this node in crate::Network::nodes.

§sample_count: usize

Total number of reporting-period pressure samples for this node.

§within_limits_count: usize

Number of samples with pressure within [min_pressure, max_pressure].

§below_min_count: usize

Number of samples below min_pressure.

§above_max_count: usize

Number of samples above max_pressure (always 0 when no upper limit is set).

§longest_violation_streak: usize

Length of the longest consecutive run of out-of-limit samples.

§pressure_deficit_integral: f64

Integral of pressure deficit over time (m · periods).

Accumulated as sum(max(min_pressure − pressure, 0)) across all samples.

§pressure_excess_integral: f64

Integral of pressure excess over time (m · periods).

Accumulated as sum(max(pressure − max_pressure, 0)) across all samples.

§worst_below_min: f64

Worst (largest) observed pressure deficit: max(min_pressure − pressure) (m).

§worst_above_max: f64

Worst (largest) observed pressure excess: max(pressure − max_pressure) (m).

Implementations§

Source§

impl ServiceComplianceNode

Source

pub fn violating_sample_count(&self) -> usize

Number of samples that fell outside the acceptable pressure range.

Source

pub fn violation_ratio(&self) -> f64

Fraction of samples that were out-of-limit, in [0, 1].

Trait Implementations§

Source§

impl Clone for ServiceComplianceNode

Source§

fn clone(&self) -> ServiceComplianceNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServiceComplianceNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ServiceComplianceNode

Source§

fn default() -> ServiceComplianceNode

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.