pub struct BalancedOperatingPointBuilder { /* private fields */ }Expand description
Bulk constructor for a balanced operating point series. Identities resolve once against the network’s stable order — buses in bus table order by ID, elements in table order by payload identity — and every column is validated against that order and the point count. Dense columns are point major; sparse columns override one base row per point by identity.
Implementations§
Source§impl BalancedOperatingPointBuilder
impl BalancedOperatingPointBuilder
pub fn new(network: BalancedNetwork, time_points: Vec<TimePoint>) -> Self
Sourcepub fn for_point(network: BalancedNetwork) -> Self
pub fn for_point(network: BalancedNetwork) -> Self
Start a builder for one operating point.
Sourcepub fn bus_voltage_magnitudes(self, values: Vec<f64>) -> Self
pub fn bus_voltage_magnitudes(self, values: Vec<f64>) -> Self
Dense bus voltage magnitudes: point_count * n_buses values in bus
table order, point major.
pub fn bus_voltage_angles(self, values: Vec<f64>) -> Self
pub fn bus_active_injections(self, values: Vec<f64>) -> Self
pub fn bus_reactive_injections(self, values: Vec<f64>) -> Self
pub fn generator_active_powers(self, values: Vec<f64>) -> Self
pub fn generator_reactive_powers(self, values: Vec<f64>) -> Self
pub fn generator_voltage_setpoints(self, values: Vec<f64>) -> Self
pub fn generator_in_service(self, values: Vec<bool>) -> Self
pub fn load_active_powers(self, values: Vec<f64>) -> Self
pub fn load_reactive_powers(self, values: Vec<f64>) -> Self
pub fn branch_in_service(self, values: Vec<bool>) -> Self
pub fn branch_tap_ratios(self, values: Vec<f64>) -> Self
pub fn branch_phase_shifts(self, values: Vec<f64>) -> Self
pub fn switch_closed(self, values: Vec<bool>) -> Self
Sourcepub fn sparse_bus_voltage_magnitudes(
self,
base: Vec<f64>,
changes: Vec<Vec<(String, f64)>>,
) -> Self
pub fn sparse_bus_voltage_magnitudes( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
Sparse bus voltage magnitudes: one base row plus per point overrides keyed by bus identity.
pub fn sparse_bus_voltage_angles( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_bus_active_injections( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_bus_reactive_injections( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_generator_active_powers( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_generator_reactive_powers( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_generator_voltage_setpoints( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_generator_in_service( self, base: Vec<bool>, changes: Vec<Vec<(String, bool)>>, ) -> Self
Sourcepub fn sparse_load_active_powers(
self,
base: Vec<f64>,
changes: Vec<Vec<(String, f64)>>,
) -> Self
pub fn sparse_load_active_powers( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
Sparse load active powers: one base row in load table order plus per point overrides keyed by payload identity.
pub fn sparse_load_reactive_powers( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_branch_in_service( self, base: Vec<bool>, changes: Vec<Vec<(String, bool)>>, ) -> Self
pub fn sparse_branch_tap_ratios( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_branch_phase_shifts( self, base: Vec<f64>, changes: Vec<Vec<(String, f64)>>, ) -> Self
pub fn sparse_switch_closed( self, base: Vec<bool>, changes: Vec<Vec<(String, bool)>>, ) -> Self
Sourcepub fn build(self) -> Result<TimeSeries<OperatingPoint<BalancedNetwork>>, Error>
pub fn build(self) -> Result<TimeSeries<OperatingPoint<BalancedNetwork>>, Error>
Resolve every identity once, validate every column, and build the series. The points share the network handle and the columns.
§Errors
A shape mismatch, a duplicate or unknown identity, or a time axis whose length disagrees with the columns.
Sourcepub fn build_point(self) -> Result<OperatingPoint<BalancedNetwork>, Error>
pub fn build_point(self) -> Result<OperatingPoint<BalancedNetwork>, Error>
Build one operating point.
§Errors
The builder does not contain exactly one point, or a quantity is invalid.