Skip to main content

VariableRef

Enum VariableRef 

Source
pub enum VariableRef {
Show 19 variants HydroStorage { hydro_id: EntityId, }, HydroTurbined { hydro_id: EntityId, block_id: Option<usize>, }, HydroSpillage { hydro_id: EntityId, block_id: Option<usize>, }, HydroDiversion { hydro_id: EntityId, block_id: Option<usize>, }, HydroOutflow { hydro_id: EntityId, block_id: Option<usize>, }, HydroGeneration { hydro_id: EntityId, block_id: Option<usize>, }, HydroEvaporation { hydro_id: EntityId, }, HydroWithdrawal { hydro_id: EntityId, }, ThermalGeneration { thermal_id: EntityId, block_id: Option<usize>, }, LineDirect { line_id: EntityId, block_id: Option<usize>, }, LineReverse { line_id: EntityId, block_id: Option<usize>, }, BusDeficit { bus_id: EntityId, block_id: Option<usize>, }, BusExcess { bus_id: EntityId, block_id: Option<usize>, }, PumpingFlow { station_id: EntityId, block_id: Option<usize>, }, PumpingPower { station_id: EntityId, block_id: Option<usize>, }, ContractImport { contract_id: EntityId, block_id: Option<usize>, }, ContractExport { contract_id: EntityId, block_id: Option<usize>, }, NonControllableGeneration { source_id: EntityId, block_id: Option<usize>, }, NonControllableCurtailment { source_id: EntityId, block_id: Option<usize>, },
}
Expand description

Reference to a single LP variable in a generic constraint expression.

Each variant names the variable type and carries the entity ID. For block-specific variables, block_id is None to sum over all blocks or Some(i) to reference block i specifically.

The 19 variants cover the full variable catalog defined in internal-structures.md §15 (table in the “Variable References” section).

Variants§

§

HydroStorage

Reservoir storage level for a hydro plant (stage-level, not block-specific).

Fields

§hydro_id: EntityId

Hydro plant identifier.

§

HydroTurbined

Turbined water flow for a hydro plant (m³/s).

Fields

§hydro_id: EntityId

Hydro plant identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

HydroSpillage

Spillage flow for a hydro plant (m³/s).

Fields

§hydro_id: EntityId

Hydro plant identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

HydroDiversion

Diversion flow for a hydro plant (m³/s). Only valid for hydros with diversion.

Fields

§hydro_id: EntityId

Hydro plant identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

HydroOutflow

Total outflow (turbined + spillage) for a hydro plant (m³/s).

Currently an alias for turbined + spillage. Future CEPEL formulations may turn this into an independent variable.

Fields

§hydro_id: EntityId

Hydro plant identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

HydroGeneration

Electrical generation from a hydro plant (MW).

Fields

§hydro_id: EntityId

Hydro plant identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

HydroEvaporation

Evaporation flow from a hydro reservoir (m³/s). Stage-level, not block-specific.

Fields

§hydro_id: EntityId

Hydro plant identifier.

§

HydroWithdrawal

Water withdrawal from a hydro reservoir (m³/s). Stage-level, not block-specific.

Fields

§hydro_id: EntityId

Hydro plant identifier.

§

ThermalGeneration

Electrical generation from a thermal unit (MW).

Fields

§thermal_id: EntityId

Thermal unit identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

LineDirect

Direct (forward) power flow on a transmission line (MW).

Fields

§line_id: EntityId

Transmission line identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

LineReverse

Reverse power flow on a transmission line (MW).

Fields

§line_id: EntityId

Transmission line identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

BusDeficit

Load deficit (unserved energy) at a bus (MW).

Fields

§bus_id: EntityId

Bus identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

BusExcess

Load excess (over-generation) at a bus (MW).

Fields

§bus_id: EntityId

Bus identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

PumpingFlow

Pumped water flow at a pumping station (m³/s).

Fields

§station_id: EntityId

Pumping station identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

PumpingPower

Electrical power consumed by a pumping station (MW).

Fields

§station_id: EntityId

Pumping station identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

ContractImport

Energy imported via a contract (MW).

Fields

§contract_id: EntityId

Energy contract identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

ContractExport

Energy exported via a contract (MW).

Fields

§contract_id: EntityId

Energy contract identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

NonControllableGeneration

Generation from a non-controllable source (wind, solar, etc.) (MW).

Fields

§source_id: EntityId

Non-controllable source identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

§

NonControllableCurtailment

Curtailment of a non-controllable source (MW).

Fields

§source_id: EntityId

Non-controllable source identifier.

§block_id: Option<usize>

Block index. None = sum over all blocks; Some(i) = block i.

Trait Implementations§

Source§

impl Clone for VariableRef

Source§

fn clone(&self) -> VariableRef

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VariableRef

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for VariableRef

Source§

fn eq(&self, other: &VariableRef) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for VariableRef

Source§

impl Eq for VariableRef

Source§

impl StructuralPartialEq for VariableRef

Auto Trait Implementations§

Blanket Implementations§

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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.