FlowLP class
#include <gtopt/flow_lp.hpp>
Base classes
-
template<typename ObjectType ObjectType>class ObjectLP<Flow>
- Wrapper class that adds LP capabilities to objects.
Public types
- using object_type = Flow
- Type of the wrapped object.
Public static variables
- static constexpr LPClassName ClassName
Constructors, destructors, conversion operators
- FlowLP(const Flow& pflow, 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 aperture_value(ScenarioUid scenario_uid, StageUid stage_uid, BlockUid block_uid) const -> std::optional<double>
- Return the discharge value for a given scenario/stage/block.
- auto class_name(this const Self& self) -> constexpr auto noexcept
- auto flow(this auto&& self) -> constexpr auto&& noexcept
- auto flow_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> auto&&
- auto has_junction() const -> bool 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 is_input() const -> constexpr bool noexcept
- auto junction_sid() const -> auto
- 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 Flow&& noexcept
- auto object() & -> constexpr Flow& noexcept
- Gets the wrapped object.
- auto object() const && -> constexpr const Flow&& noexcept
- auto object() const & -> constexpr const Flow& 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 flow column bounds in a cloned LP for an aperture scenario.
Typedef documentation
using gtopt:: FlowLP:: object_type = Flow
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
std::optional<double> gtopt:: FlowLP:: aperture_value(ScenarioUid scenario_uid,
StageUid stage_uid,
BlockUid block_uid) const
Return the discharge value for a given scenario/stage/block.
| Parameters | |
|---|---|
| scenario_uid | Scenario UID to look up |
| stage_uid | Stage UID to look up |
| block_uid | Block UID to look up |
| Returns | Optional discharge value if present |
constexpr auto gtopt:: FlowLP:: class_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: FlowLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: FlowLP:: 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:: FlowLP:: 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:: FlowLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
Args && ... args)
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: FlowLP:: lp_label(this const Self& self,
SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
const BlockLP& block,
Args && ... args)
constexpr Flow&& gtopt:: FlowLP:: object() && noexcept
#include <gtopt/object_lp.hpp>
constexpr Flow& gtopt:: FlowLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
constexpr const Flow&& gtopt:: FlowLP:: object() const && noexcept
#include <gtopt/object_lp.hpp>
constexpr const Flow& gtopt:: FlowLP:: object() const & noexcept
#include <gtopt/object_lp.hpp>
constexpr auto gtopt:: FlowLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
#include <gtopt/object_utils.hpp>
constexpr auto gtopt:: FlowLP:: 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:: FlowLP:: 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:: FlowLP:: 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:: FlowLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|
bool gtopt:: FlowLP:: update_aperture(LinearInterface& li,
const ScenarioLP& base_scenario,
const std::function<std::optional<double>(StageUid, BlockUid)>& value_fn,
const StageLP& stage) const
Update flow column bounds in a cloned LP for an aperture scenario.
| Parameters | |
|---|---|
| li | The cloned LinearInterface to modify (in-place). |
| base_scenario | The scenario used when the LP was originally built. |
| value_fn | (StageUid, BlockUid) -> optional<double> provider. |
| stage | The stage for which to update the bounds. |
| Returns | true on success. |
During the SDDP backward pass with apertures, the flow columns that were originally fixed to the base scenario's discharge values are updated to reflect the aperture scenario's discharge values. The value_fn callable provides the new discharge value for each (stage, block) pair.