EmissionSourceLP class
#include <gtopt/emission_source_lp.hpp>
Base classes
-
template<typename ObjectType>class ObjectLP<EmissionSource>
- Wrapper class that adds LP capabilities to objects.
Public types
- struct EmissionLeg
- using Base = ObjectLP<EmissionSource>
- using Element = EmissionSource
- using object_type = EmissionSource
- Type of the wrapped object.
Public static variables
- static std::string_view CapturedName
- static std::string_view CombustionName
- static std::string_view EmissionsName
- Output stream / PAMPL attribute names.
- static std::string_view FuelRateName
- static std::string_view RateName
- static std::string_view UpstreamName
- static std::string_view UpstreamRateName
Constructors, destructors, conversion operators
- EmissionSourceLP(const EmissionSource& src, const 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 emission_source(this auto&& 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() && -> EmissionSource&& noexcept
- auto object() & -> EmissionSource& noexcept
- Gets the wrapped object.
- auto object() const && -> const EmissionSource&& noexcept
- auto object() const & -> const EmissionSource& 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
Parameter accessors (resolved schedules)
- using BlockEmission = std::vector<EmissionLeg>
- OptTRealSched rate_
- OptTRealSched upstream_rate_
- OptTRealSched fuel_rate_
- OptTRealSched upstream_fuel_rate_
- STBIndexHolder<BlockEmission> block_emissions_
- STBIndexHolder<double> rate_values_
- STBIndexHolder<double> upstream_rate_values_
- STBIndexHolder<double> fuel_rate_values_
- auto param_rate(StageUid s) const -> auto
- auto param_upstream_rate(StageUid s) const -> auto
- auto param_fuel_rate(StageUid s) const -> auto
- auto param_upstream_fuel_rate(StageUid s) const -> auto
Typedef documentation
using gtopt:: EmissionSourceLP:: Element = EmissionSource
#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:: EmissionSourceLP:: object_type = EmissionSource
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
bool gtopt:: EmissionSourceLP:: add_to_lp(const SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
LinearProblem& lp)
Stamp α = weight · (1 − capture) · (rate + upstream) · dur on every generator-dispatch column of this (scenario, stage) into the zone's cap row and/or allowance-pool row, add the zone's per-tonne price adder to the column cost, and add a per-MWh CCS opex adder when Generator.emission_captures[] carries a row for this pollutant. EmissionZoneLP::add_to_lp must run BEFORE this — guaranteed by the lp_element_types_t visitor ordering (same dependency InertiaProvisionLP has on InertiaZoneLP).
bool gtopt:: EmissionSourceLP:: add_to_output(OutputContext& out) const
Emits per-source per-block emission breakdown streams. Reads the dispatch primal via OutputContext::primal(gen_col) and multiplies by the per-(stage, block) factors cached in add_to_lp to produce:
EmissionSource/emissions_sol.parquet — NET tons (post-capture) EmissionSource/combustion_sol.parquet — combustion-only post-capture EmissionSource/upstream_sol.parquet — WTT post-capture (only emitted when upstream_rate is non-zero at any (s, t, b)) EmissionSource/captured_sol.parquet — captured tons (only when capture_rate > 0) EmissionSource/rate_sol.parquet — combustion rate [t/MWh], replicated per block from the per-stage schedule. EmissionSource/upstream_rate_sol.parquet — WTT rate [t/MWh] (only emitted when upstream_rate is non-zero).
All tons values are physical tons per block, computed Path A from source schedules + post-solve generation primal; rate streams are the raw input coefficient broadcast to the (scenario, stage, block) grid for ease of post-processing in tools/notebooks.
auto gtopt:: EmissionSourceLP:: class_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
auto gtopt:: EmissionSourceLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
bool gtopt:: EmissionSourceLP:: 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 |
EmissionSource&& gtopt:: EmissionSourceLP:: object() && noexcept
#include <gtopt/object_lp.hpp>
EmissionSource& gtopt:: EmissionSourceLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
const EmissionSource&& gtopt:: EmissionSourceLP:: object() const && noexcept
#include <gtopt/object_lp.hpp>
const EmissionSource& gtopt:: EmissionSourceLP:: object() const & noexcept
#include <gtopt/object_lp.hpp>
auto& gtopt:: EmissionSourceLP:: 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:: EmissionSourceLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
auto gtopt:: EmissionSourceLP:: 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:: EmissionSourceLP:: sv_key(this const Self& self,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
auto gtopt:: EmissionSourceLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|