GeneratorProfileLP class
#include <gtopt/generator_profile_lp.hpp>
Linear programming representation of a generator profile.
Handles the LP formulation of generator profile constraints including:
- Spillover variable management
- Profile constraint generation
- Solution output processing
Base classes
- class ProfileObjectLP<GeneratorProfile, GeneratorLP>
- Base class for profile-based LP objects.
Public types
- using Base = ObjectLP<GeneratorProfile>
- using object_type = ObjectType
- Type of the wrapped object.
Public static variables
- static constexpr LPClassName ClassName
- Class name constant used for labeling LP elements.
Constructors, destructors, conversion operators
- GeneratorProfileLP(const GeneratorProfile& pgenerator_profile, InputContext& ic) explicit
Public functions
- auto add_profile_to_lp(std::string_view cname, const SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp, std::string_view profile_name, const auto& element_cols, const std::optional<ColIndex>& capacity_col, double stage_capacity) -> bool
- Add profile constraints to LP.
- auto add_profile_to_output(std::string_view cname, OutputContext& out, std::string_view profile_name) const -> bool
- Add profile results to output.
- 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 aperture_value(ScenarioUid scenario_uid, StageUid stage_uid, BlockUid block_uid) const -> std::optional<double>
- Return the profile value for a given scenario/stage/block.
- auto class_name(this const Self& self) -> constexpr auto noexcept
- auto generator_profile(this auto&& self) -> constexpr auto&& noexcept
- auto generator_sid() const -> constexpr auto 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 update_aperture(LinearInterface& li, const ScenarioLP& base_scenario, const std::function<std::optional<double>(StageUid, BlockUid)>& value_fn, const StageLP& stage) const -> bool
- Update profile constraints for an aperture scenario.
Typedef documentation
using gtopt:: GeneratorProfileLP:: Base = ObjectLP<GeneratorProfile>
#include <gtopt/profile_object_lp.hpp>
using gtopt:: GeneratorProfileLP:: object_type = ObjectType
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
bool gtopt:: GeneratorProfileLP:: add_profile_to_lp(std::string_view cname,
const SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
LinearProblem& lp,
std::string_view profile_name,
const auto& element_cols,
const std::optional<ColIndex>& capacity_col,
double stage_capacity)
#include <gtopt/profile_object_lp.hpp>
Add profile constraints to LP.
| Parameters | |
|---|---|
| cname | Class name prefix for labeling |
| sc | System context |
| scenario | Scenario |
| stage | Stage |
| lp | Linear problem |
| profile_name | Profile type name ("spillover"/"unserved") |
| element_cols | Element column indices per block |
| capacity_col | Capacity column index (if any) |
| stage_capacity | Stage capacity value |
| Returns | true if successful |
bool gtopt:: GeneratorProfileLP:: add_profile_to_output(std::string_view cname,
OutputContext& out,
std::string_view profile_name) const
#include <gtopt/profile_object_lp.hpp>
Add profile results to output.
| Parameters | |
|---|---|
| cname | Class name prefix for labeling |
| out | Output context |
| profile_name | Profile type name ("spillover"/"unserved") |
| Returns | true if successful |
std::optional<double> gtopt:: GeneratorProfileLP:: aperture_value(ScenarioUid scenario_uid,
StageUid stage_uid,
BlockUid block_uid) const
#include <gtopt/profile_object_lp.hpp>
Return the profile value for a given scenario/stage/block.
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: GeneratorProfileLP:: class_name(this const Self& self) noexcept
constexpr auto gtopt:: GeneratorProfileLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorProfileLP:: 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:: GeneratorProfileLP:: 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:: GeneratorProfileLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
Args && ... args)
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorProfileLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
const BlockLP& block,
Args && ... args)
constexpr ObjectType&& gtopt:: GeneratorProfileLP:: object() && noexcept
#include <gtopt/object_lp.hpp>
constexpr ObjectType& gtopt:: GeneratorProfileLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
constexpr const ObjectType&& gtopt:: GeneratorProfileLP:: object() const && noexcept
#include <gtopt/object_lp.hpp>
constexpr const ObjectType& gtopt:: GeneratorProfileLP:: object() const & noexcept
#include <gtopt/object_lp.hpp>
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: GeneratorProfileLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: GeneratorProfileLP:: 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:: GeneratorProfileLP:: 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:: GeneratorProfileLP:: 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:: GeneratorProfileLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|