TurbineLP class
#include <gtopt/turbine_lp.hpp>
Linear programming representation of a hydroelectric turbine.
This class extends ObjectLP to provide LP-specific functionality for turbines, including:
- Conversion rate constraints between water flow and power generation
- Relationships with connected waterways and generators
- Output of dual variables for sensitivity analysis
Base classes
-
template<typename ObjectType ObjectType>class ObjectLP<Turbine>
- Wrapper class that adds LP capabilities to objects.
Public types
- using object_type = Turbine
- Type of the wrapped object.
Public static variables
- static constexpr LPClassName ClassName
Constructors, destructors, conversion operators
- TurbineLP(const Turbine& pturbine, InputContext& ic) explicit
- Construct a TurbineLP from a Turbine and input context.
Public functions
- auto add_to_lp(const SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp) -> bool
- Adds turbine constraints to the linear problem.
- auto add_to_output(OutputContext& out) const -> bool
- Adds turbine dual variables to the output context.
- auto class_name(this const Self& self) -> constexpr auto noexcept
- auto conversion_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const BIndexHolder< RowIndex > & -> auto
- Access conversion-rate constraint row indices for a (scenario, stage)
- auto drain() const -> constexpr auto noexcept
- auto flow_sid() const -> FlowLPSId -> auto
- 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 Turbine&& noexcept
- auto object() & -> constexpr Turbine& noexcept
- Gets the wrapped object.
- auto object() const && -> constexpr const Turbine&& noexcept
- auto object() const & -> constexpr const Turbine& 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 turbine(this auto&& self) -> constexpr auto&& noexcept
- auto uid() const -> constexpr auto noexcept
- auto uses_flow() const -> constexpr bool noexcept
- auto waterway_sid() const -> WaterwayLPSId -> auto
Typedef documentation
using gtopt:: TurbineLP:: object_type = Turbine
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
gtopt:: TurbineLP:: TurbineLP(const Turbine& pturbine,
InputContext& ic) explicit
Construct a TurbineLP from a Turbine and input context.
| Parameters | |
|---|---|
| pturbine | The turbine to represent |
| ic | Input context containing system configuration |
bool gtopt:: TurbineLP:: add_to_lp(const SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
LinearProblem& lp)
Adds turbine constraints to the linear problem.
| Parameters | |
|---|---|
| sc | System context containing component relationships |
| scenario | Current scenario being processed |
| stage | Current stage being processed |
| lp | Linear problem to add constraints to |
| Returns | true if successful, false on error |
Adds constraints that enforce the relationship between water flow through the turbine and electrical power generation based on the conversion rate.
bool gtopt:: TurbineLP:: add_to_output(OutputContext& out) const
Adds turbine dual variables to the output context.
| Parameters | |
|---|---|
| out | Output context to write results to |
| Returns | true if successful, false on error |
Outputs the dual variables associated with the turbine's conversion rate constraints for sensitivity analysis.
constexpr auto gtopt:: TurbineLP:: class_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: TurbineLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: TurbineLP:: 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:: TurbineLP:: 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:: TurbineLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
Args && ... args)
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: TurbineLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
const BlockLP& block,
Args && ... args)
constexpr Turbine&& gtopt:: TurbineLP:: object() && noexcept
#include <gtopt/object_lp.hpp>
constexpr Turbine& gtopt:: TurbineLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
constexpr const Turbine&& gtopt:: TurbineLP:: object() const && noexcept
#include <gtopt/object_lp.hpp>
constexpr const Turbine& gtopt:: TurbineLP:: object() const & noexcept
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: TurbineLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: TurbineLP:: 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:: TurbineLP:: 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:: TurbineLP:: 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:: TurbineLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|