pub struct Fingerprint {
pub buses: usize,
pub base_mva: i64,
pub degrees: Vec<usize>,
pub impedances: Vec<i64>,
pub hvdc: usize,
pub load_p: i64,
pub load_q: i64,
}Expand description
What makes two files the same case.
The whole struct is the bucketing key. It deliberately leaves out the load, generator and shunt counts: formats merge and split devices at a bus (PSS/E states three loads where MATPOWER states one bus demand), so those counts differ between honest siblings while the demand they sum to does not.
Fields§
§buses: usize§base_mva: i64§degrees: Vec<usize>Sorted bus degrees over in-service branches. Invariant under bus renumbering, sensitive to a lost or added branch.
impedances: Vec<i64>Sorted quantized |z| of every branch.
hvdc: usizeNumber of DC lines. A case with an HVDC link is a different case from the AC network underneath it, however alike the two look.
load_p: i64§load_q: i64Implementations§
Source§impl Fingerprint
impl Fingerprint
pub fn of(net: &BalancedNetwork) -> Self
Sourcepub fn of_distribution(net: &MulticonductorNetwork) -> Self
pub fn of_distribution(net: &MulticonductorNetwork) -> Self
A multiconductor network’s fingerprint.
Coarser than the balanced one: a distribution line carries an impedance
matrix rather than a scalar, so there is no |z| multiset to compare,
and the degree sequence runs over lines, switches and transformers
together because formats disagree about which of the three a given
device is.
Sourcepub fn primary(&self) -> PrimaryKey
pub fn primary(&self) -> PrimaryKey
The coarse bucketing key: the part of the fingerprint that is exact even across a lossy text format. Sorting by it gives the bucket ordinals, so a bucket id derives from electrical content and from nothing in the source.
Sourcepub fn agrees_with(&self, other: &Self) -> bool
pub fn agrees_with(&self, other: &Self) -> bool
Whether two fingerprints sharing a PrimaryKey really are the same
case.
Compared with a tolerance rather than by quantized equality: two siblings whose impedance lands either side of a quantum boundary are still the same case, and exact equality on a rounded value would split them. The quantized fields exist to make the fingerprint serializable and sortable; agreement is decided here.
Trait Implementations§
Source§impl Clone for Fingerprint
impl Clone for Fingerprint
Source§impl Debug for Fingerprint
impl Debug for Fingerprint
Source§impl<'de> Deserialize<'de> for Fingerprint
impl<'de> Deserialize<'de> for Fingerprint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Fingerprint
Source§impl Ord for Fingerprint
impl Ord for Fingerprint
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Fingerprint
impl PartialEq for Fingerprint
Source§impl PartialOrd for Fingerprint
impl PartialOrd for Fingerprint
Source§impl Serialize for Fingerprint
impl Serialize for Fingerprint
impl StructuralPartialEq for Fingerprint
Auto Trait Implementations§
impl Freeze for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnsafeUnpin for Fingerprint
impl UnwindSafe for Fingerprint
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.