CommitmentLP class
#include <gtopt/commitment_lp.hpp>
Base classes
-
template<typename ObjectType>class ObjectLP<Commitment>
- Wrapper class that adds LP capabilities to objects.
Public types
- using Base = ObjectLP<Commitment>
- using Element = Commitment
- using object_type = Commitment
- Type of the wrapped object.
Public static variables
- static std::string_view ColdStartName
- static std::string_view ExclusionName
- static std::string_view GenLowerName
- static std::string_view GenUpperName
- static std::string_view HotStartName
- static std::string_view LogicName
- static std::string_view MaxStartsName
- static std::string_view MinDownTimeName
- static std::string_view MinStartsName
- static std::string_view MinUpTimeName
- static std::string_view OperationWearCostName
- static std::string_view PowerName
- power_based: total power at the end of each block [MW]
- static std::string_view RampDownName
- static std::string_view RampUpName
- static std::string_view SegmentName
- static std::string_view ShutdownName
- static std::string_view ShutdownTransitionName
- static std::string_view StartupName
- static std::string_view StartupTransitionName
- static std::string_view StartupTypeName
- static std::string_view StartupWearCostName
- Wear cost outputs ($ per start event, $/h per block).
- static std::string_view StatusName
- static double usage_at_pmin_abs_tol
- "At pmin" tolerance: p ≤ Pmin·u + abs + rel·Pmin [MW].
- static double usage_at_pmin_rel_tol
- static double usage_on_status
- Status above which a (relaxed) unit counts as committed.
- static std::string_view UsageAtPminName
- static std::string_view UsagePminName
- Usage-accounting output streams (
options.output_usage_metrics). - static std::string_view WarmStartName
Constructors, destructors, conversion operators
- CommitmentLP(const Commitment& commitment, const InputContext& ic) explicit
Public functions
- auto add_to_lp(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 commitment(this auto&& self) -> auto&& noexcept
- auto committed_pmin(StageUid stage_uid, BlockUid block_uid) const -> std::optional<double>
- auto find_power_cols(const ScenarioLP& scenario, const StageLP& stage) const -> const BIndexHolder<ColIndex>*
- auto find_ramp_up_rows(const ScenarioLP& scenario, const StageLP& stage) const -> const BIndexHolder<RowIndex>*
- auto find_shutdown_cols(const ScenarioLP& scenario, const StageLP& stage) const -> const BIndexHolder<ColIndex>*
- auto find_startup_cols(const ScenarioLP& scenario, const StageLP& stage) const -> const BIndexHolder<ColIndex>*
- auto find_status_cols(const ScenarioLP& scenario, const StageLP& stage) const -> const BIndexHolder<ColIndex>*
- auto generator_sid() const -> auto noexcept
- auto id() const -> auto noexcept
- auto is_active(const StageLP& stage) const -> bool
- Checks if object is active in given stage.
- auto lookup_status_col(const ScenarioLP& scenario, const StageLP& stage, BlockUid buid) const -> std::optional<ColIndex> noexcept
- auto noload_fuel_leg(const ScenarioLP& scenario, const StageLP& stage, BlockUid buid) const -> std::optional<std::pair<ColIndex, double>>
- auto object() && -> Commitment&& noexcept
- auto object() & -> Commitment& noexcept
- Gets the wrapped object.
- auto object() const && -> const Commitment&& noexcept
- auto object() const & -> const Commitment& 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 uid() const -> auto noexcept
Typedef documentation
using gtopt:: CommitmentLP:: Element = Commitment
#include <gtopt/object_lp.hpp>
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:: CommitmentLP:: object_type = Commitment
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
bool gtopt:: CommitmentLP:: add_to_lp(SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
LinearProblem& lp)
< real length of the stage period [h]
< node time [h] (real)
< real-time start of the current block
auto gtopt:: CommitmentLP:: class_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
std::optional<double> gtopt:: CommitmentLP:: committed_pmin(StageUid stage_uid,
BlockUid block_uid) const
Scheduled Commitment.pmin [MW] at (stage, block), or nullopt when unset (the LP then uses Generator.pmin). See the free function committed_pmin.
const BIndexHolder<ColIndex>* gtopt:: CommitmentLP:: find_power_cols(const ScenarioLP& scenario,
const StageLP& stage) const
Per-block startup (v) columns for a (scenario, stage); nullptr when the commitment is inactive there. Used by the MIP-start CommitmentLogicRule to derive v from the repaired status (u) transitions so the C1 logic rows (u[p] - u[p-1] - v[p] + w[p] = 0) hold for the injected integer start. power_based: P̂ (total power at the end of each block), or null.
const BIndexHolder<RowIndex>* gtopt:: CommitmentLP:: find_ramp_up_rows(const ScenarioLP& scenario,
const StageLP& stage) const
Per-node ramp-up (C4) rows for a (scenario, stage), keyed by block uid; nullptr when the commitment has no ramp rows there.
const BIndexHolder<ColIndex>* gtopt:: CommitmentLP:: find_shutdown_cols(const ScenarioLP& scenario,
const StageLP& stage) const
Per-block shutdown (w) columns for a (scenario, stage); nullptr when the commitment is inactive there. Companion to find_startup_cols.
const BIndexHolder<ColIndex>* gtopt:: CommitmentLP:: find_status_cols(const ScenarioLP& scenario,
const StageLP& stage) const
Tolerant lookup of the per-block status (u) columns for a given (scenario, stage). Returns nullptr when the commitment is inactive for that cell or has no status columns yet (e.g., add_to_lp not yet called on this scenario/stage). Used by ReserveProvisionLP::add_to_lp to inject the provision_col - urmin × u_commit ≥ 0 linkage row that gates PLEXOS-style Min Provision by the commit binary.
auto gtopt:: CommitmentLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
bool gtopt:: CommitmentLP:: is_active(const StageLP& stage) const
#include <gtopt/object_lp.hpp>
Checks if object is active in given stage.
| Parameters | |
|---|---|
| stage | The stage to check |
| Returns | true if active in stage, false otherwise |
std::optional<ColIndex> gtopt:: CommitmentLP:: lookup_status_col(const ScenarioLP& scenario,
const StageLP& stage,
BlockUid buid) const noexcept
Status (u) column of block buid — every block of a commitment period maps to the period's column — or nullopt when the element built none there.
std::optional<std::pair<ColIndex, double>> gtopt:: CommitmentLP:: noload_fuel_leg(const ScenarioLP& scenario,
const StageLP& stage,
BlockUid buid) const
No-load fuel burn leg (u_col, noload_fuel) [fuel-unit / h per unit of status] for block buid, or std::nullopt when noload_fuel is unset / zero or the status column does not exist.
Commitment&& gtopt:: CommitmentLP:: object() && noexcept
#include <gtopt/object_lp.hpp>
Commitment& gtopt:: CommitmentLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
const Commitment&& gtopt:: CommitmentLP:: object() const && noexcept
#include <gtopt/object_lp.hpp>
const Commitment& gtopt:: CommitmentLP:: object() const & noexcept
#include <gtopt/object_lp.hpp>
auto& gtopt:: CommitmentLP:: set_id(Uid uid,
Name name) noexcept
#include <gtopt/object_lp.hpp>
Sets the object's identifier.
| Parameters | |
|---|---|
| uid | Unique identifier |
| name | Human-readable name |
| Returns | Reference to self for chaining |
auto gtopt:: CommitmentLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
auto gtopt:: CommitmentLP:: sv_key(this const Self& self,
const ScenarioLP& scenario,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
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:: CommitmentLP:: sv_key(this const Self& self,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
auto gtopt:: CommitmentLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|
Variable documentation
static std::string_view gtopt:: CommitmentLP:: StartupTransitionName
Fixed start / shutdown between consecutive stages declared long_transition off → on / on → off.