pub struct InflowModel {
pub hydro_id: EntityId,
pub stage_id: i32,
pub mean_m3s: f64,
pub std_m3s: f64,
pub ar_coefficients: Vec<f64>,
pub residual_std_ratio: f64,
}Expand description
Raw PAR(p) model parameters for a single (hydro, stage) pair.
Stores the seasonal mean, standard deviation, and standardized AR lag
coefficients loaded from inflow_seasonal_stats.parquet and
inflow_ar_coefficients.parquet. These are the raw input-facing values.
AR coefficients are stored standardized by seasonal std (dimensionless ψ*,
direct Yule-Walker output). The residual_std_ratio field carries the ratio
σ_m / s_m so that downstream crates can recover the runtime residual std as
std_m3s * residual_std_ratio without re-deriving it from the coefficients.
The performance-adapted view (PrecomputedParLp) is built from these
parameters once at solver initialisation and belongs to downstream solver crates.
§Declaration-order invariance
The System holds a Vec<InflowModel> sorted by (hydro_id, stage_id).
All processing must iterate in that canonical order.
See internal-structures.md §14 and PAR Inflow Model §7.
§Examples
use cobre_core::{EntityId, scenario::InflowModel};
let model = InflowModel {
hydro_id: EntityId(1),
stage_id: 3,
mean_m3s: 150.0,
std_m3s: 30.0,
ar_coefficients: vec![0.45, 0.22],
residual_std_ratio: 0.85,
};
assert_eq!(model.ar_order(), 2);
assert_eq!(model.ar_coefficients.len(), 2);
assert!((model.residual_std_ratio - 0.85).abs() < f64::EPSILON);Fields§
§hydro_id: EntityIdHydro plant this model belongs to.
stage_id: i32Stage (0-based index within System::stages) this model applies to.
mean_m3s: f64Seasonal mean inflow μ in m³/s.
std_m3s: f64Seasonal standard deviation s_m in m³/s (seasonal sample std).
ar_coefficients: Vec<f64>AR lag coefficients [ψ*₁, ψ*₂, …, ψ*ₚ] standardized by seasonal std (dimensionless). These are the direct Yule-Walker output. Length is the AR order p. Empty when p == 0 (white noise).
residual_std_ratio: f64Ratio of residual standard deviation to seasonal standard deviation
(σ_m / s_m). Dimensionless, in (0, 1]. The runtime residual std is
std_m3s * residual_std_ratio. When ar_coefficients is empty
(white noise), this is 1.0 (the AR model explains nothing).
Implementations§
Trait Implementations§
Source§impl Clone for InflowModel
impl Clone for InflowModel
Source§fn clone(&self) -> InflowModel
fn clone(&self) -> InflowModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more