FutureCostLP class
#include <gtopt/future_cost_lp.hpp>
Base classes
-
template<typename ObjectType>class ObjectLP<FutureCost>
- Wrapper class that adds LP capabilities to objects.
Public types
- using Element = FutureCost
- using object_type = FutureCost
- Type of the wrapped object.
Public static variables
- static std::string_view AlphaName
- Output stream names (no magic strings — see feedback_no_magic_strings).
- static std::string_view ApproxFcfName
- static std::string_view RebaseName
Public static functions
- static auto add_to_global_lp(const SystemContext& sc, const SceneLP& scene, const PhaseLP& phase, LinearProblem& lp) -> bool
Constructors, destructors, conversion operators
- FutureCostLP(const FutureCost& pfc, const InputContext& ic) explicit
Public functions
- auto add_to_output(OutputContext& out) const -> bool
- auto class_name(this const Self& self) -> auto noexcept
- auto future_cost(this auto&& self) -> auto&& noexcept
- auto id() const -> auto noexcept
- auto is_active(const StageLP& stage) const -> bool
- Checks if object is active in given stage.
- auto object() & -> FutureCost& noexcept
- Gets the wrapped object.
- auto set_id(Uid uid, Name name) -> auto& noexcept
- Sets the object's identifier.
- auto short_name(this const Self& self) -> auto noexcept
- auto sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) -> 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) -> auto noexcept
- auto uid() const -> auto noexcept
Typedef documentation
using gtopt:: FutureCostLP:: Element = FutureCost
#include <gtopt/object_lp.hpp>
Alias for the wrapped data-struct type. Lets generic code reach the canonical LPClassName constant via T::Element::class_name where T is any LP wrapper inheriting from ObjectLP. Single source of truth for the class-name constant lives on the data struct (Bus::class_name, Reservoir::class_name, …); the LP wrappers no longer carry a duplicate ClassName member.
using gtopt:: FutureCostLP:: object_type = FutureCost
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
static bool gtopt:: FutureCostLP:: add_to_global_lp(const SystemContext& sc,
const SceneLP& scene,
const PhaseLP& phase,
LinearProblem& lp)
Planning-level GLOBAL scope: registers the α / varphi_s columns, loads the boundary cuts, applies the mean_shift rebase (anchored at the reservoirs' efin targets), and stores the α col handles + per-scene c̄. Runs once per (scene, phase) cell after the operational add_to_lp loop (see system_lp.cpp::add_to_planning_lp).
Piece-2 step A: inert plumbing. The α / boundary-cut / rebase logic migrates here from sddp_method_alpha.cpp + sddp_boundary_cuts.cpp in step D, guarded by the mean_shift bound-consistency regression test.
bool gtopt:: FutureCostLP:: add_to_output(OutputContext& out) const
Emits the α / varphi_s solution(s) + the per-scene rebase constant c̄ to FutureCost/{alpha|alpha_<s>, rebase}. SELF-FINDS its data at write time: the α columns are read from the persistent SimulationLP state-variable registry (via alpha_cols_on_cell) and the rebase constant from SimulationLP::alpha_offset, both reached through OutputContext::system_context(). Because these registries persist across per-cell LP rebuilds, the output works under ALL low_memory modes — no per-cell resident stash is needed. alpha + rebase reconstructs the un-rebased FCF.
auto gtopt:: FutureCostLP:: class_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
auto gtopt:: FutureCostLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
bool gtopt:: FutureCostLP:: is_active(const StageLP& stage) const
#include <gtopt/object_lp.hpp>
Checks if object is active in given stage.
| Parameters | |
|---|---|
| stage | The stage to check |
| Returns | true if active in stage, false otherwise |
FutureCost& gtopt:: FutureCostLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
auto& gtopt:: FutureCostLP:: set_id(Uid uid,
Name name) noexcept
#include <gtopt/object_lp.hpp>
Sets the object's identifier.
| Parameters | |
|---|---|
| uid | Unique identifier |
| name | Human-readable name |
| Returns | Reference to self for chaining |
auto gtopt:: FutureCostLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
auto gtopt:: FutureCostLP:: sv_key(this const Self& self,
const ScenarioLP& scenario,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
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 |
auto gtopt:: FutureCostLP:: sv_key(this const Self& self,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
auto gtopt:: FutureCostLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|