pub struct PsseEquipmentIndex<'n> { /* private fields */ }Expand description
The PSS/E id every element of a network would carry in a RAW file written
from it, with the lookups a .con statement needs.
The ids come from the RAW writer’s own allocation: an element’s retained id
when it has one and that id is still free on its key, compared trimmed, else
the lowest positive integer still free there. That is why an id the reader
dropped as a positional default (1) comes back, and why parallel elements
stay distinct.
Building the index walks every table once. Resolving many sets against one
network builds it once and calls ContingencySet::resolve_with. The index
borrows the network it was built from, so a row it states is always a row of
that network.
Implementations§
Source§impl<'n> PsseEquipmentIndex<'n>
impl<'n> PsseEquipmentIndex<'n>
Sourcepub fn new(net: &'n BalancedNetwork) -> PsseEquipmentIndex<'n>
pub fn new(net: &'n BalancedNetwork) -> PsseEquipmentIndex<'n>
Recompute every PSS/E id in net and index the rows by it.
Sourcepub fn network(&self) -> &'n BalancedNetwork
pub fn network(&self) -> &'n BalancedNetwork
The network the index was built from. Every row it states indexes a table of this network.
Sourcepub fn machine_ids(&self) -> &[String]
pub fn machine_ids(&self) -> &[String]
The machine id of every generator, aligned with net.generators().
Sourcepub fn circuit_ids(&self) -> &[String]
pub fn circuit_ids(&self) -> &[String]
The circuit id of every branch, aligned with net.branches().
Sourcepub fn transformer_3w_ids(&self) -> &[String]
pub fn transformer_3w_ids(&self) -> &[String]
The circuit id of every three winding transformer, aligned with
net.transformers_3w().
Sourcepub fn branch_rows(&self, from: BusId, to: BusId, circuit: &str) -> Vec<usize>
pub fn branch_rows(&self, from: BusId, to: BusId, circuit: &str) -> Vec<usize>
The rows of net.branches() joining from and to on circuit, in
either orientation. A self-loop is counted once. More than one row
means the statement names several branches and binds to none of them.
The lines answer first and the two winding transformers only when no
line carries the circuit id, because the RAW writer allocates the two
families apart and a .con statement names a branch without saying
which table it sits in.
Sourcepub fn machine_row(&self, bus: BusId, id: &str) -> Option<usize>
pub fn machine_row(&self, bus: BusId, id: &str) -> Option<usize>
The row of net.generators() for machine id at bus. PSS/E requires
machine ids to be unique on a bus and the writer’s allocation preserves
that, so at most one row matches. id is matched trimmed, against the
trimmed id the writer allocates.
Sourcepub fn fixed_shunt_rows(&self, bus: BusId, id: Option<&str>) -> Vec<usize>
pub fn fixed_shunt_rows(&self, bus: BusId, id: Option<&str>) -> Vec<usize>
The rows of net.shunts() holding a fixed shunt at bus: the one with
this id, or every fixed shunt there when no id is stated.
Sourcepub fn switched_shunt_rows(&self, bus: BusId) -> Vec<usize>
pub fn switched_shunt_rows(&self, bus: BusId) -> Vec<usize>
The rows of net.shunts() holding a switched shunt at bus, every one
of them. The .con grammar states REMOVE SWSHUNT FROM BUS i and
carries no id, as the RAW switched shunt record itself does not, so the
statement addresses every switched shunt at the bus.
Sourcepub fn load_rows(&self, bus: BusId, id: Option<&str>) -> Vec<usize>
pub fn load_rows(&self, bus: BusId, id: Option<&str>) -> Vec<usize>
The rows of net.loads() at bus: the one with this id, or every load
there when no id is stated.
Sourcepub fn transformer_3w_row(
&self,
buses: [BusId; 3],
circuit: &str,
) -> Option<usize>
pub fn transformer_3w_row( &self, buses: [BusId; 3], circuit: &str, ) -> Option<usize>
The row of net.transformers_3w() on these three buses and circuit id.
The buses match in any order, because a .con statement need not state
them in winding order. When several transformers on the same three
buses carry the same id, the first in table order is returned;
PsseEquipmentIndex::transformer_3w_rows states all of them.
Sourcepub fn transformer_3w_rows(
&self,
buses: [BusId; 3],
circuit: &str,
) -> Vec<usize>
pub fn transformer_3w_rows( &self, buses: [BusId; 3], circuit: &str, ) -> Vec<usize>
The rows of net.transformers_3w() on these three buses and circuit
id, in table order. The buses match in any order. More than one row
means the statement names several transformers and binds to none of
them, which happens when two transformers on the same three buses are
stored in different winding orders and take the same id.
Trait Implementations§
Source§impl<'n> Clone for PsseEquipmentIndex<'n>
impl<'n> Clone for PsseEquipmentIndex<'n>
Source§fn clone(&self) -> PsseEquipmentIndex<'n>
fn clone(&self) -> PsseEquipmentIndex<'n>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more