gtopt::FuelLP class

Base classes

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

Public types

using Base = ObjectLP<Fuel>
using Element = Fuel
using object_type = Fuel
Type of the wrapped object.

Public static variables

static std::string_view MaxOfftakeName
LP row / col name constants (snake_case for output filenames).
static std::string_view MaxOfftakeSlackName
static std::string_view MinOfftakeName
static std::string_view MinOfftakeSlackName
static std::string_view OfftakeName

Constructors, destructors, conversion operators

FuelLP(const Fuel& fuel, 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 fuel(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() && -> Fuel&& noexcept
auto object() & -> Fuel& noexcept
Gets the wrapped object.
auto object() const && -> const Fuel&& noexcept
auto object() const & -> const Fuel& 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)

Per-(stage, block) fuel price. Back-compat: a scalar or per-stage Fuel.price broadcasts to every block, so callers that previously read a per-stage price keep getting the same value.

auto param_price(StageUid s, BlockUid b) const -> auto
auto param_heat_content(StageUid s) const -> auto
auto param_combustion_emission_factor(StageUid s) const -> auto
auto param_upstream_emission_factor(StageUid s) const -> auto
auto param_max_offtake(StageUid s) const -> auto
auto param_max_offtake_cost(StageUid s) const -> auto
auto param_min_offtake(StageUid s) const -> auto
auto param_min_offtake_cost(StageUid s) const -> auto

Typedef documentation

using gtopt::FuelLP::Element = Fuel

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::FuelLP::object_type = Fuel

Type of the wrapped object.

Function documentation

bool gtopt::FuelLP::add_to_lp(const SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp)

LP-active hooks. When max_offtake is unset on every stage these are effectively no-ops — FuelLP retains its passive-parameter behaviour for downstream consumers (GeneratorLP, EmissionLP).

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

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

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

bool gtopt::FuelLP::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

Fuel&& gtopt::FuelLP::object() && noexcept

Fuel& gtopt::FuelLP::object() & noexcept

Gets the wrapped object.

Returns Reference to the wrapped object

const Fuel&& gtopt::FuelLP::object() const && noexcept

const Fuel& gtopt::FuelLP::object() const & noexcept

auto& gtopt::FuelLP::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::FuelLP::short_name(this const Self& self) noexcept

auto gtopt::FuelLP::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::FuelLP::sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) noexcept

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

Returns The object's unique identifier

Variable documentation

static std::string_view gtopt::FuelLP::MinOfftakeName

Symmetric min-side floor names — see Fuel::min_offtake. When both min_offtake and max_offtake are populated FuelLP emits two separate rows sharing the same weighted generator-side LHS (Σ heat_rate · dur · gen_g). Each side gets its own dual stream + slack column when softened by a positive *_cost.

static std::string_view gtopt::FuelLP::OfftakeName

PAMPL accessor for the fuel offtake expression. Resolves to the weighted sum Σ_g heat_rate_g · dur_b · generation_g[b] of every active consumer's dispatch column — registered as an AMPL block_cols_weighted_sum attribute, so no aggregator LP column is created. Lets PLEXOS Offtake Coefficient UCs (Gas_MaxOpDay*, FueMaxOff*) translate as the single LHS term α × fuel("X").offtake.