pub struct SubstationSiting {
pub load_points: Vec<(f64, f64, f64)>,
pub n_substations: usize,
pub voltage_kv: f64,
pub cable_cost_million_eur_per_km: f64,
}Expand description
Geographic substation siting via load-weighted k-means clustering.
Each cluster centroid represents an optimal substation location that minimises the total weighted distance (≈ cable length) to served load points.
Fields§
§load_points: Vec<(f64, f64, f64)>Load points: (x_km, y_km, load_mw).
n_substations: usizeDesired number of substations.
voltage_kv: f64Nominal voltage of the distribution feeder [kV].
cable_cost_million_eur_per_km: f64Cable cost per km [million EUR/km].
Implementations§
Source§impl SubstationSiting
impl SubstationSiting
Sourcepub fn new(
load_points: Vec<(f64, f64, f64)>,
n_substations: usize,
voltage_kv: f64,
cable_cost_million_eur_per_km: f64,
) -> Self
pub fn new( load_points: Vec<(f64, f64, f64)>, n_substations: usize, voltage_kv: f64, cable_cost_million_eur_per_km: f64, ) -> Self
Construct a new siting problem.
Sourcepub fn optimize_kmeans(
&self,
max_iter: usize,
) -> Result<SitingResult, OxiGridError>
pub fn optimize_kmeans( &self, max_iter: usize, ) -> Result<SitingResult, OxiGridError>
Optimise substation locations using load-weighted k-means.
Initialisation: spread substations by percentile of x-coordinate, choosing the load-weighted centroid within each segment as the initial centre.
Iteration: assign each load point to its nearest substation (Euclidean), recompute load-weighted centroids. Converge when centroid shift < 0.01 km.
Auto Trait Implementations§
impl Freeze for SubstationSiting
impl RefUnwindSafe for SubstationSiting
impl Send for SubstationSiting
impl Sync for SubstationSiting
impl Unpin for SubstationSiting
impl UnsafeUnpin for SubstationSiting
impl UnwindSafe for SubstationSiting
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.