gtopt::ReservoirDischargeLimitLP class

LP wrapper for ReservoirDischargeLimit constraints.

Base classes

template<typename ObjectType>
class ObjectLP<ReservoirDischargeLimit>
Wrapper class that adds LP capabilities to objects.

Public types

struct RDLState
Tracks current LP state for coefficient updates.
using Element = ReservoirDischargeLimit
using object_type = ReservoirDischargeLimit
Type of the wrapped object.

Public static variables

static std::string_view DvolName

Constructors, destructors, conversion operators

ReservoirDischargeLimitLP(const ReservoirDischargeLimit& ddl, InputContext& ic) explicit

Public functions

auto add_to_lp(const SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp) -> bool
auto add_to_output(OutputContext& out) const -> bool
auto class_name(this const Self& self) -> auto noexcept
auto id() const -> auto noexcept
auto is_active(const StageLP& stage) const -> bool
Checks if object is active in given stage.
auto object() & -> ReservoirDischargeLimit& noexcept
Gets the wrapped object.
auto reservoir_discharge_limit(this auto&& self) -> auto&& noexcept
auto reservoir_sid() const -> auto noexcept
auto set_id(Uid uid, Name name) -> auto& noexcept
Sets the object's identifier.
auto short_name(this const Self& self) -> auto noexcept
auto sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) -> auto noexcept
Generates a state variable key for the object.
auto sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) -> auto noexcept
auto turbine_sid() const -> TurbineLPSId
auto uid() const -> auto noexcept
auto update_lp(SystemLP& sys, const ScenarioLP& scenario, const StageLP& stage) -> int
Update volume-dependent LP coefficients.
auto uses_turbine() const -> bool noexcept
auto waterway_sid() const -> WaterwayLPSId

Typedef documentation

using gtopt::ReservoirDischargeLimitLP::Element = ReservoirDischargeLimit

Alias for the wrapped data-struct type. Lets generic code reach the canonical LPClassName constant via T::Element::class_name where T is any LP wrapper inheriting from ObjectLP. Single source of truth for the class-name constant lives on the data struct (Bus::class_name, Reservoir::class_name, …); the LP wrappers no longer carry a duplicate ClassName member.

using gtopt::ReservoirDischargeLimitLP::object_type = ReservoirDischargeLimit

Type of the wrapped object.

Function documentation

auto gtopt::ReservoirDischargeLimitLP::class_name(this const Self& self) noexcept

auto gtopt::ReservoirDischargeLimitLP::id() const noexcept

Returns The object's complete identifier (uid + name)

bool gtopt::ReservoirDischargeLimitLP::is_active(const StageLP& stage) const

Checks if object is active in given stage.

Parameters
stage The stage to check
Returns true if active in stage, false otherwise

ReservoirDischargeLimit& gtopt::ReservoirDischargeLimitLP::object() & noexcept

Gets the wrapped object.

Returns Reference to the wrapped object

auto& gtopt::ReservoirDischargeLimitLP::set_id(Uid uid, Name name) noexcept

Sets the object's identifier.

Parameters
uid Unique identifier
name Human-readable name
Returns Reference to self for chaining

auto gtopt::ReservoirDischargeLimitLP::short_name(this const Self& self) noexcept

auto gtopt::ReservoirDischargeLimitLP::sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) noexcept

Generates a state variable key for the object.

Parameters
self Reference to the object
scenario Scenario context
stage Stage context
col_name The column name for the state variable
Returns StateVariable::Key

auto gtopt::ReservoirDischargeLimitLP::sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) noexcept

auto gtopt::ReservoirDischargeLimitLP::uid() const noexcept

Returns The object's unique identifier

int gtopt::ReservoirDischargeLimitLP::update_lp(SystemLP& sys, const ScenarioLP& scenario, const StageLP& stage)

Update volume-dependent LP coefficients.

Returns Number of LP coefficients/bounds modified (0 if unchanged)

Selects the active piecewise segment based on the reservoir's current volume and updates the slope coefficient on eini/efin columns and the RHS intercept in the volume constraint row.

bool gtopt::ReservoirDischargeLimitLP::uses_turbine() const noexcept

Returns Whether the discharge limit references a built-in waterway turbine's flow column (true) instead of a classic Waterway (false).