gtopt::ConverterLP class

Base classes

template<typename Object Object>
struct CapacityObjectLP<Converter>
A linear programming representation of an object with capacity constraints.

Public types

using Base = ObjectLP<Converter>
using CapacityAndCol = std::pair<std::optional<double>, std::optional<ColIndex>>
Pair of optional capacity value and optional expansion column index.
using CapacityBase = CapacityObjectLP<Converter>
using object_type = ObjectType
Type of the wrapped object.

Public static variables

static constexpr LPClassName ClassName

Constructors, destructors, conversion operators

ConverterLP(const Converter& pconverter, 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 battery_sid() const -> constexpr auto noexcept
auto capacity_and_col(const StageLP& stage, LinearProblem& lp) const -> CapacityAndCol -> constexpr auto
Query capacity value and optional expansion column for a stage.
auto capacity_at(const StageLP& stage, const double def_capacity = std::numeric_limits<double>::max()) const -> constexpr double
Get the capacity at a specific stage.
auto capacity_col_at(const StageLP& stage) const -> constexpr auto noexcept
Get the column index for capacity at a specific stage.
template<typename Self Self>
auto class_name(this const Self& self) -> constexpr auto noexcept
auto converter(this auto&& self) -> constexpr auto&& noexcept
auto demand_sid() const -> constexpr auto noexcept
auto generator_sid() const -> constexpr auto noexcept
auto id() const -> constexpr const Id& noexcept
auto id() const -> constexpr auto noexcept
template<typename StageLP StageLP>
auto is_active(const StageLP& stage) const -> constexpr bool
Checks if object is active in given stage.
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_label(this const Self& self, SystemContext& sc, const StageLP& stage, Args && ... args) -> constexpr auto
auto object() && -> constexpr ObjectType&& noexcept
auto object() & -> constexpr ObjectType& noexcept
Gets the wrapped object.
auto object() const && -> constexpr const ObjectType&& noexcept
auto object() const & -> constexpr const ObjectType& noexcept
auto set_id(Uid uid, Name name) -> constexpr auto& noexcept
Sets the object's identifier.
template<typename Self Self>
auto short_name(this const Self& self) -> constexpr auto noexcept
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
Generates a label for a variable in the optimization problem.
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
template<typename Self Self, typename ScenarioLP ScenarioLP, typename StageLP StageLP>
auto sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) -> constexpr auto noexcept
Generates a state variable key for the object.
template<typename Self Self, typename StageLP StageLP>
auto sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) -> constexpr auto noexcept
auto uid() const -> constexpr auto noexcept
auto uid() const -> constexpr auto noexcept

Typedef documentation

using gtopt::ConverterLP::Base = ObjectLP<Converter>

using gtopt::ConverterLP::CapacityAndCol = std::pair<std::optional<double>, std::optional<ColIndex>>

Pair of optional capacity value and optional expansion column index.

using gtopt::ConverterLP::object_type = ObjectType

Type of the wrapped object.

Function documentation

constexpr auto gtopt::ConverterLP::capacity_and_col(const StageLP& stage, LinearProblem& lp) const -> CapacityAndCol

Query capacity value and optional expansion column for a stage.

Parameters
stage The stage to query
lp Linear problem reference (needed for expansion col bounds)

Returns {std::optional<double>, std::optional<ColIndex>}. The capacity is nullopt when no expansion column exists AND no capacity schedule value is defined — i.e. when the physical capacity is truly undefined. Callers that need a numeric fallback should use value_or(default) on the returned optional.

constexpr double gtopt::ConverterLP::capacity_at(const StageLP& stage, const double def_capacity = std::numeric_limits<double>::max()) const

Get the capacity at a specific stage.

Parameters
stage The stage to query capacity for
def_capacity Default value if capacity not specified (default: unlimited)
Returns The capacity at given stage or default if not specified

constexpr auto gtopt::ConverterLP::capacity_col_at(const StageLP& stage) const noexcept

Get the column index for capacity at a specific stage.

Parameters
stage The stage to get column index for
Returns Optional containing column index if exists

template<typename Self Self>
constexpr auto gtopt::ConverterLP::class_name(this const Self& self) noexcept

constexpr const Id& gtopt::ConverterLP::id() const noexcept

constexpr auto gtopt::ConverterLP::id() const noexcept

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

template<typename StageLP StageLP>
constexpr bool gtopt::ConverterLP::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

template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ConverterLP::lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args)

template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ConverterLP::lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args)

template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ConverterLP::lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args)

template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ConverterLP::lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args)

template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ConverterLP::lp_label(this const Self& self, SystemContext& sc, const StageLP& stage, Args && ... args)

constexpr ObjectType&& gtopt::ConverterLP::object() && noexcept

constexpr ObjectType& gtopt::ConverterLP::object() & noexcept

Gets the wrapped object.

Returns Reference to the wrapped object

constexpr const ObjectType&& gtopt::ConverterLP::object() const && noexcept

constexpr const ObjectType& gtopt::ConverterLP::object() const & noexcept

constexpr auto& gtopt::ConverterLP::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

template<typename Self Self>
constexpr auto gtopt::ConverterLP::short_name(this const Self& self) noexcept

template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ConverterLP::state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args)

Generates a label for a variable in the optimization problem.

Parameters
self Reference to the object
sc System context
scenario Scenario context
stage Stage context
args Additional arguments to include in the label
Returns Label string

template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ConverterLP::state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args)

template<typename Self Self, typename ScenarioLP ScenarioLP, typename StageLP StageLP>
constexpr auto gtopt::ConverterLP::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

template<typename Self Self, typename StageLP StageLP>
constexpr auto gtopt::ConverterLP::sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) noexcept

constexpr auto gtopt::ConverterLP::uid() const noexcept

constexpr auto gtopt::ConverterLP::uid() const noexcept

Returns The object's unique identifier