StorageOptions struct
#include <gtopt/storage_lp.hpp>
Options controlling storage LP behaviour for a single add_to_lp call.
Public variables
- bool break_stage_chain
- std::string_view class_name
- bool daily_cycle
- double default_annual_standing_loss
- double dual_scale
- double energy_scale
- double flow_scale
- std::optional<StorageIntegration> integration
- double max_cycles_day
- double scost
- bool skip_state_link
- bool use_state_variable
- Uid variable_uid
- Element UID for per-element VariableScaleMap lookup.
- double water_value_hint
Variable documentation
bool gtopt:: StorageOptions:: break_stage_chain
Break the same-phase stage chain at this (reset) stage: instead of reusing the previous stage's efin column as this stage's initial energy, create a FRESH eini column that the caller provisions (bounds pin or a debit/credit row). Without this, an in-phase reset would pin the PREVIOUS stage's ending volume — corrupting the prior balance (the previous efin column and this stage's initial state are the same LP column in the shared-LP layout). No effect on the first stage of a phase (cross-phase boundaries already allocate a fresh sini column).
std::string_view gtopt:: StorageOptions:: class_name
Full class name for VariableScaleMap metadata (e.g. "Reservoir", "Battery"). When non-empty, StorageBase sets class_name/variable_name on energy columns so LinearProblem::add_col can auto-resolve scales.
bool gtopt:: StorageOptions:: daily_cycle
PLP daily-cycle mode: scale block durations in the energy balance by 24/stage_duration and close each stage with efin==eini. Implies use_state_variable=false.
double gtopt:: StorageOptions:: default_annual_standing_loss
Self-discharge [p.u./year] used for every stage where the element's own annual_standing_loss schedule has no value. 0.0 (lossless) for all storages except Battery, which passes PlanningOptionsLP::battery_annual_standing_loss() (default 0.48 = 4 %/month).
double gtopt:: StorageOptions:: dual_scale
Explicit post-equilibration factor for the energy-balance row (SparseRow::post_scale); 1.0 = off.
double gtopt:: StorageOptions:: energy_scale
Energy (volume) scale factor: the LP energy variable is divided by this value so that the LP works in scaled units (physical_energy / energy_scale). Default 1.0 = no scaling. For reservoirs the default is 100000 (dam³→Gm³) and for batteries 0.01.
double gtopt:: StorageOptions:: flow_scale
Flow variable scale factor applied to finp/fout/drain LP variables.
flatten() applies col_scale to both flow and energy column coefficients, so the physical coefficient in the energy-balance row is simply:
coeff = flow_conversion_rate × duration
For drain: bounds are divided and LP cost is multiplied by flow_scale so that the physical objective value is preserved.
Default 1.0 = no flow scaling (battery behaviour is unchanged).
std::optional<StorageIntegration> gtopt:: StorageOptions:: integration
Point-stage storage integration rule resolved for the element (PlanningOptionsLP::storage_integration(element, reservoir)); unset: the global storage_integration.
double gtopt:: StorageOptions:: max_cycles_day
Daily energy-throughput cap N (PLEXOS Max Cycles Day). 0 = off; >0 = emit per-day cycle_limit rows enforcing Σ_{b∈window} (fcr / fout_eff_b) · duration(b) · dc_stage_scale · fout[b] ≤ N · capacity. Generic to all storage elements; only the parameter is element-supplied (Battery passes battery().max_cycles_day; Reservoir/VolumeRight leave it at 0).
double gtopt:: StorageOptions:: scost
State cost for elastic penalty [$/physical_unit]. Passed to the StateVariable at registration time so the SDDP elastic filter can apply per-variable penalty costs. Default 0.0 = use global penalty.
bool gtopt:: StorageOptions:: skip_state_link
Skip linking sini to the previous phase's efin at this cross-phase boundary. When true, the sini column is left free (within emin/emax bounds) so that the caller can fix it to a provisioned value (e.g., VolumeRight reset_month). The efin StateVariable is still registered for outgoing propagation to the next phase.
This prevents SDDP from propagating stale duals backward through a rights reset boundary, and from overwriting the provisioned eini with the previous phase's efin trial value in the forward pass.
Should only be set when the stage is a phase boundary AND the storage element's initial state is independently determined (reset/reprovision).
For SAME-PHASE reset stages use break_stage_chain instead — skip_state_link only affects the cross-phase sini creation.
bool gtopt:: StorageOptions:: use_state_variable
Propagate SoC/energy across phase/stage boundaries via StateVariables. Forced to false when daily_cycle is true.
double gtopt:: StorageOptions:: water_value_hint
Expected |water value| [$/physical_unit] used to set SparseRow::dual_hint on the energy-balance row (0 = none).