Skip to main content

surge_network/network/
region.rs

1// SPDX-License-Identifier: LicenseRef-PolyForm-Noncommercial-1.0.0
2//! Region (zone) data.
3//!
4//! A region is a named grouping of buses used for administrative and
5//! reporting purposes. Each bus carries a region number (`bus.zone`).
6//! PSS/E RAW section: "ZONE DATA".
7
8use serde::{Deserialize, Serialize};
9
10/// A named region (PSS/E zone) — a grouping of buses.
11///
12/// The region number is carried on each bus as `bus.zone`. This struct
13/// provides the name lookup table so that zone numbers can be resolved
14/// to human-readable names during export and reporting.
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct Region {
17    /// Region number (ZONUM in PSS/E).
18    pub number: u32,
19    /// Region name, up to 12 characters (ZONAME in PSS/E).
20    pub name: String,
21}
22
23impl Default for Region {
24    fn default() -> Self {
25        Self {
26            number: 1,
27            name: String::new(),
28        }
29    }
30}