GeneratorLP class
#include <gtopt/generator_lp.hpp>
Base classes
- struct CapacityObjectLP<Generator>
- A linear programming representation of an object with capacity constraints.
Public types
- using Base = ObjectLP<Generator>
- using CapacityAndCol = std::pair<std::optional<double>, std::optional<ColIndex>>
- Pair of optional capacity value and optional expansion column index.
- using CapacityBase = CapacityObjectLP<Generator>
- using object_type = ObjectType
- Type of the wrapped object.
Public static variables
- static constexpr LPClassName ClassName
Constructors, destructors, conversion operators
- GeneratorLP(const Generator& generator, const InputContext& ic) explicit
- Constructs a GeneratorLP from a Generator.
Public functions
- auto add_to_lp(SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp) -> bool
- Adds generator variables and constraints to the linear problem.
- auto add_to_output(OutputContext& out) const -> bool
- Adds generator output results to the output context.
- auto bus_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.
- auto class_name(this const Self& self) -> constexpr auto noexcept
- auto generation_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto generator(this auto&& self) -> constexpr auto&& noexcept
- auto id() const -> constexpr const Id& noexcept
- auto id() const -> constexpr auto noexcept
- auto is_active(const StageLP& stage) const -> constexpr bool
- Checks if object is active in given stage.
- auto lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
- auto lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
- auto lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
- auto lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
- 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.
- auto short_name(this const Self& self) -> constexpr auto noexcept
- 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.
- auto state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
- 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.
- 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
Parameter accessors for user constraint resolution
- auto param_pmax(StageUid s, BlockUid b) const -> auto
- auto param_pmin(StageUid s, BlockUid b) const -> auto
- auto param_gcost(StageUid s) const -> auto
- auto param_lossfactor(StageUid s) const -> auto
Typedef documentation
using gtopt:: GeneratorLP:: Base = ObjectLP<Generator>
#include <gtopt/capacity_object_lp.hpp>
using gtopt:: GeneratorLP:: CapacityAndCol = std::pair<std::optional<double>, std::optional<ColIndex>>
#include <gtopt/capacity_object_lp.hpp>
Pair of optional capacity value and optional expansion column index.
using gtopt:: GeneratorLP:: object_type = ObjectType
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
gtopt:: GeneratorLP:: GeneratorLP(const Generator& generator,
const InputContext& ic) explicit
Constructs a GeneratorLP from a Generator.
| Parameters | |
|---|---|
| generator | Generator object to convert to LP representation |
| ic | Input context for parameter processing |
Creates an LP representation of a generator including time-dependent parameters like minimum/maximum generation limits, loss factors, and costs.
bool gtopt:: GeneratorLP:: add_to_lp(SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
LinearProblem& lp)
Adds generator variables and constraints to the linear problem.
| Parameters | |
|---|---|
| sc | System context containing current state |
| scenario | |
| stage | |
| lp | Linear problem to add variables and constraints to |
| Returns | True if successful, false otherwise |
This method creates:
- Generation variables for each time block
- Capacity constraints linking generation to installed capacity
- Contributions to bus power balance equations
It handles:
- Time-dependent generation limits
- Generator loss factors
- Generation costs in the objective function
- Capacity constraints when capacity expansion is modeled
bool gtopt:: GeneratorLP:: add_to_output(OutputContext& out) const
Adds generator output results to the output context.
| Parameters | |
|---|---|
| out | Output context to add results to |
| Returns | True if successful, false otherwise |
Processes planning results for:
- Generation variables (primal solution and costs)
- Capacity constraint dual values (shadow prices)
- Capacity-related outputs via base class
constexpr auto gtopt:: GeneratorLP:: capacity_and_col(const StageLP& stage,
LinearProblem& lp) const -> CapacityAndCol
#include <gtopt/capacity_object_lp.hpp>
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:: GeneratorLP:: capacity_at(const StageLP& stage,
const double def_capacity = std::numeric_limits<double>:: max()) const
#include <gtopt/capacity_object_lp.hpp>
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:: GeneratorLP:: capacity_col_at(const StageLP& stage) const noexcept
#include <gtopt/capacity_object_lp.hpp>
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 |
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: GeneratorLP:: class_name(this const Self& self) noexcept
constexpr const Id& gtopt:: GeneratorLP:: id() const noexcept
#include <gtopt/capacity_object_lp.hpp>
constexpr auto gtopt:: GeneratorLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorLP:: lp_col_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
Args && ... args)
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorLP:: lp_col_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
const BlockLP& block,
Args && ... args)
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
Args && ... args)
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
const BlockLP& block,
Args && ... args)
constexpr ObjectType&& gtopt:: GeneratorLP:: object() && noexcept
#include <gtopt/object_lp.hpp>
constexpr ObjectType& gtopt:: GeneratorLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
constexpr const ObjectType&& gtopt:: GeneratorLP:: object() const && noexcept
#include <gtopt/object_lp.hpp>
constexpr const ObjectType& gtopt:: GeneratorLP:: object() const & noexcept
#include <gtopt/object_lp.hpp>
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: GeneratorLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorLP:: 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 |
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorLP:: state_col_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
const BlockLP& block,
Args && ... args)
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorLP:: 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 |
constexpr auto gtopt:: GeneratorLP:: uid() const noexcept
#include <gtopt/capacity_object_lp.hpp>
constexpr auto gtopt:: GeneratorLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|