Skip to main content

PsseEquipmentIndex

Struct PsseEquipmentIndex 

Source
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>

Source

pub fn new(net: &'n BalancedNetwork) -> PsseEquipmentIndex<'n>

Recompute every PSS/E id in net and index the rows by it.

Source

pub fn network(&self) -> &'n BalancedNetwork

The network the index was built from. Every row it states indexes a table of this network.

Source

pub fn machine_ids(&self) -> &[String]

The machine id of every generator, aligned with net.generators().

Source

pub fn circuit_ids(&self) -> &[String]

The circuit id of every branch, aligned with net.branches().

Source

pub fn transformer_3w_ids(&self) -> &[String]

The circuit id of every three winding transformer, aligned with net.transformers_3w().

Source

pub fn bus_row(&self, bus: BusId) -> Option<usize>

The row of bus in net.buses().

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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>

Source§

fn clone(&self) -> PsseEquipmentIndex<'n>

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<'n> Debug for PsseEquipmentIndex<'n>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V