pub struct ReliabilityCalculator {
pub customers: Vec<CustomerData>,
pub events: Vec<InterruptionEvent>,
pub period_years: f64,
pub voll_usd_per_mwh: f64,
pub cemi_n_threshold: usize,
pub celid_l_threshold_h: f64,
}Expand description
Main reliability calculator implementing IEEE 1366 distribution indices and Monte Carlo bulk-system adequacy assessment.
§Example
use oxigrid::network::reliability_indices::{
CustomerData, InterruptionEvent, InterruptionCause, ReliabilityCalculator,
};
let customers = vec![
CustomerData { id: 0, n_customers: 500, load_kw: 1000.0, feeder_id: 0, substation_id: 0 },
];
let calc = ReliabilityCalculator::new(customers, vec![], 1.0);
let idx = calc.compute_indices();
assert_eq!(idx.saidi, 0.0);
assert_eq!(idx.asai, 1.0);Fields§
§customers: Vec<CustomerData>Customer records for the study area.
events: Vec<InterruptionEvent>Interruption events recorded over the observation period.
period_years: f64Length of the observation window (years).
voll_usd_per_mwh: f64Value of lost load (USD / MWh) used for bulk cost calculation.
cemi_n_threshold: usizeThreshold N for the CEMI-N index (interruptions per period).
celid_l_threshold_h: f64Threshold L for the CELID index (cumulative hours outage per period).
Implementations§
Source§impl ReliabilityCalculator
impl ReliabilityCalculator
Sourcepub fn new(
customers: Vec<CustomerData>,
events: Vec<InterruptionEvent>,
period_years: f64,
) -> Self
pub fn new( customers: Vec<CustomerData>, events: Vec<InterruptionEvent>, period_years: f64, ) -> Self
Create a new calculator with default VOLL (10 000 USD/MWh) and default CEMI-N / CELID thresholds (N = 3, L = 2 h).
Sourcepub fn compute_indices(&self) -> ReliabilityIndices
pub fn compute_indices(&self) -> ReliabilityIndices
Compute all IEEE 1366-2012 system-level reliability indices.
Returns ReliabilityIndices::default (ASAI = 1) when there are no
customers or no events.
Sourcepub fn compute_feeder_indices(&self) -> Vec<FeederReliability>
pub fn compute_feeder_indices(&self) -> Vec<FeederReliability>
Compute IEEE 1366 indices broken down by feeder.
Each FeederReliability contains indices computed using only the
customers and events belonging to that feeder.
Sourcepub fn compute_bulk_reliability(
&self,
units: &[GenerationUnit],
peak_load_mw: f64,
n_trials: usize,
) -> BulkSystemReliability
pub fn compute_bulk_reliability( &self, units: &[GenerationUnit], peak_load_mw: f64, n_trials: usize, ) -> BulkSystemReliability
Compute bulk system reliability indices via sequential Monte Carlo.
Uses an LCG PRNG (no external rand crate) to determine each unit’s
state for n_trials independent hour-samples.
§Arguments
units— Generating units in the fleet.peak_load_mw— System peak load (MW) used as the load target.n_trials— Number of Monte Carlo samples (≥ 1000 recommended).
Sourcepub fn identify_bad_actors(&self, top_n: usize) -> Vec<(usize, f64)>
pub fn identify_bad_actors(&self, top_n: usize) -> Vec<(usize, f64)>
Identify the top_n feeders with the highest contribution to system SAIDI.
Returns a vector of (feeder_id, saidi_contribution_h) sorted in
descending order of SAIDI contribution.
Sourcepub fn compute_improvement_benefit(
&self,
target_feeder: usize,
target_saidi_reduction: f64,
) -> f64
pub fn compute_improvement_benefit( &self, target_feeder: usize, target_saidi_reduction: f64, ) -> f64
Estimate the system-level SAIDI improvement resulting from reducing a
single feeder’s SAIDI contribution by target_saidi_reduction hours.
The improvement is the minimum of the requested reduction and the feeder’s current SAIDI contribution.
Returns 0.0 if the feeder contributes nothing to system SAIDI.
Sourcepub fn forecast_reliability(
&self,
years: usize,
trend_pct_per_year: f64,
) -> Vec<ReliabilityIndices>
pub fn forecast_reliability( &self, years: usize, trend_pct_per_year: f64, ) -> Vec<ReliabilityIndices>
Project reliability indices into future years using a linear trend.
trend_pct_per_year is the percentage degradation per year applied to
SAIDI and SAIFI (positive = worsening, negative = improving).
§Arguments
years— Number of future years to project.trend_pct_per_year— Annual percentage change in SAIDI and SAIFI.
Returns a Vec of length years, with index 0 representing year 1.
Auto Trait Implementations§
impl Freeze for ReliabilityCalculator
impl RefUnwindSafe for ReliabilityCalculator
impl Send for ReliabilityCalculator
impl Sync for ReliabilityCalculator
impl Unpin for ReliabilityCalculator
impl UnsafeUnpin for ReliabilityCalculator
impl UnwindSafe for ReliabilityCalculator
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.