gtopt::PlanningOptionsLP class

Wrapper for PlanningOptions with default value handling.

PlanningOptionsLP wraps a PlanningOptions structure and provides accessor methods that automatically apply default values when options are not explicitly set. This ensures consistent behavior throughout the optimization code by defining system-wide defaults in one place.

Public static variables

static Real default_annual_discount_rate
Default annual discount rate for multi-year planning.
static Real default_battery_annual_standing_loss
Default Battery self-discharge [p.u./year] applied when a Battery leaves annual_standing_loss unset.
static Real default_dc_line_reactance_threshold
Default per-unit reactance floor for zero-impedance ties.
static Real default_dc_line_resistance_threshold
Default per-unit resistance floor for lossless auto-promotion.
static Real default_demand_fail_cost
Default penalty for unserved demand [$/MWh] (value of lost load).
static auto default_input_directory
Default input directory path.
static DataFormat default_input_format
Default input file format.
static KirchhoffMode default_kirchhoff_mode
Default Kirchhoff Voltage Law formulation.
static Real default_kirchhoff_threshold
Default threshold for Kirchhoff constraints.
static LineDirectionMode default_line_direction_mode
Default radial-line detection mode (off: no detection, the LP is unchanged).
static LineLossesMode default_line_losses_mode
Default line losses mode.
static LineThermalLimitMode default_line_thermal_limit_mode
Default line thermal-limit mode: the limit bounds the flow variable only (flow, no extra constraint).
static auto default_log_directory
Default directory for log/trace files.
static Real default_loss_cost_eps
Default per-MWh cost ($/MWh) on the loss columns (model_options.loss_cost_eps). 0.1 strictly breaks the LP-relax bidirectional-flow degeneracy and the tangent_signed_flow |f|-aux slack while keeping the LMP distortion negligible (measured on a CEN 5-year SDDP: small negative LMPs shrink ~8x vs eps = 1, same total losses). Inert for modes without a loss column (none, linear, piecewise_direct). Set loss_cost_eps = 0 explicitly to disable.
static Real default_loss_flow_abs_cost
Default per-MWh cost ($/MWh, real units before scale_objective) on the tangent_signed_flow abs-flow proxy columns (model_options.loss_flow_abs_cost). A degeneracy pin forcing Σ v_l = |f| at the optimum; shifts LMP differences by at most ≈ 0.001 $/MWh per lossy line. With scale_objective = 1000 it lands at 1e-6 in the LP. Set 0 to disable.
static Int default_loss_segments
Default number of flow segments per line (1 = linear model, >1 = piecewise-linear quadratic approximation of P_loss = R·f²/V²).
static double default_max_overload_ratio
static MethodType default_method_type
Default solver type.
static int default_mva_polygon_sides
static CompressionCodec default_output_compression
Default compression codec for Parquet output files.
static auto default_output_directory
Default output directory path.
static DataFormat default_output_format
Default output file format.
static int default_output_round_decimals
static Bool default_periodic_storage
static Real default_pool_max_process_swap_mb
static Real default_pool_swap_growth_mb
static PrevStageLink default_prev_stage_link
Default <attr>_prev stage-boundary link: the previous stage's last block when it is in the same phase (stage).
static Real default_scale_objective
Default objective function scaling factor for MONOLITHIC method.
static Bool default_sddp_aperture_cut_resolve
static Bool default_sddp_api_enabled
Default for SDDP monitoring API (enabled by default).
static Bool default_sddp_backward_resolve_target
static Real default_sddp_convergence_confidence
Default confidence level for statistical convergence.
static Real default_sddp_convergence_tol
Default relative convergence tolerance.
static Real default_sddp_cut_coeff_eps
Default cut coefficient epsilon for filtering tiny coefficients.
static auto default_sddp_cut_directory
Default directory for Benders cut files.
static CutDrainMode default_sddp_cut_drain_mode
Default async cut-drain mode (symmetric, deterministic).
static CutSharingMode default_sddp_cut_sharing_mode
Default cut sharing mode for SDDP.
static ElasticFilterMode default_sddp_elastic_mode
Default elastic filter mode.
static Real default_sddp_elastic_penalty
Default elastic slack penalty (per physical unit, scaled by var_scale per link inside relax_fixed_state_variable).
static Real default_sddp_fact_eps
Default PLP FactEPS tolerance for elastic_mode = state_repair (alias plp) and farkas_recursive.
static Int default_sddp_fact_max_cycles
Default PLP FactMXC solve-cycle cap for elastic_mode = state_repair (alias plp) and farkas_recursive.
static Bool default_sddp_forward_fail_stop
Default for the scene-level fail-stop forward pass.
static Bool default_sddp_forward_infeas_rollback
static ForwardSamplingMode default_sddp_forward_sampling_mode
Default forward-pass sampling mode (persistent per-scene paths — the historical behaviour; resampled opts into the per-phase-boundary probability-weighted re-draw that matches the multicut LB's stagewise-resampled process).
static IntegerCutsMode default_sddp_integer_cuts_mode
Default integer-cut mode (legacy: no strengthening; the strengthened mode is the opt-in one-MIP Lagrangian intercept for integer-bearing backward cells — see IntegerCutsMode).
static Int default_sddp_max_iterations
Default maximum SDDP iterations.
static Int default_sddp_min_iterations
Default minimum iterations before declaring convergence.
static int default_sddp_multi_cut_threshold
Default multi_cut threshold (auto-switch after this many cumulative forward-pass infeasibilities at a phase).
static Real default_sddp_stationary_gap_ceiling
Default absolute gap ceiling for the secondary convergence tests (stationary + statistical CI).
static Real default_sddp_stationary_tol
Default stationary-gap tolerance.
static Int default_sddp_stationary_window
Default look-back window for stationary gap check (one season).
static Int default_sddp_terminal_failure_threshold
Default consecutive-structural-failures threshold before a scene is marked terminal. See SDDPMethod::SceneRetryState::terminal and SDDPOptions::terminal_failure_threshold for the full story.
static Int default_sddp_update_lp_skip
Default iterations to skip between update_lp dispatches (0 = every iteration, matching PLP behaviour).
static Bool default_strict_storage_emin
Default setting for strict per-stage volume floor (emin) enforcement on reservoir_sini and the last-block efin column. true (default): both columns get lowb = stage_emin, so the per-stage volume floor is a HARD constraint at the inter-stage handoff state. Opt out with model_options.strict_storage_emin = false for the PLP- style relaxation (lowb = 0) when iter-0 of an SDDP cascade needs the floor relaxed to stay feasible.
static Real default_theta_max
Default voltage-angle bound (θ ∈ [−2π, +2π]) used as fallback when auto_scale_theta did not run (e.g. auto_scale=false). When auto-scaling is enabled the bound is replaced by Σ_l tmax_l · x_τ_l so flows can reach their full capacity.
static Bool default_tie_line_losses
Default for tie_line_losses: ties are lossless.
static TinyReactanceMode default_tiny_reactance_mode
Default treatment of nonzero sub-threshold reactances.
static Real default_tiny_reactance_rel_threshold
Default relative tie floor (tiny_reactance_rel_threshold).
static Bool default_use_kirchhoff
Default setting for Kirchhoff constraints.
static Bool default_use_line_losses
Default setting for line loss modeling (deprecated).
static Bool default_use_single_bus
Default setting for single-bus modeling.
static Bool default_use_uid_fname
Default setting for using UIDs in filenames.
static Real legacy_loss_flow_abs_cost
Pre-option internal value of the abs-flow pin ($/MWh). Setting loss_flow_abs_cost = legacy_loss_flow_abs_cost reproduces the old LP exactly (1e-9 in the LP after scale_objective = 1000: below solver dual tolerances).

Public static functions

template<typename T>
static auto fallback_3(const std::optional<T>& flat, const std::optional<T>& model, const T& def) -> T noexcept
static auto validate_enum_options() -> std::vector<std::string>

Constructors, destructors, conversion operators

PlanningOptionsLP(PlanningOptions poptions = {}) explicit
Constructs a PlanningOptionsLP wrapper around a PlanningOptions object.

Public functions

auto allow_oversupply() const -> bool
Whether the per-bus power balance is relaxed from = to ≥ (generation ≥ demand, free disposal of surplus). Default false (strict balance). See ModelOptions::allow_oversupply.
auto annual_discount_rate() const -> auto
Gets the annual discount rate, using default if not set.
auto battery_annual_standing_loss() const -> auto
auto battery_power_envelope() const -> bool
auto build_mode_enum() const -> BuildMode
auto build_pool_cpu_factor() const -> auto
LP-build work-pool CPU over-commit factor (default: 2.0).
auto cascade_levels() const -> const auto& noexcept
Cascade level configurations. Empty → use built-in defaults.
auto cascade_sddp_options() const -> const auto& noexcept
Global cascade SDDP options (serve as defaults for all levels).
auto cascade_write_level_outputs() const -> auto noexcept
auto classify_line_reactance(std::optional<double> reactance, double voltage) const -> LineKvlKind
Classify a line's stage reactance for KVL assembly (dc / zero-impedance tie / regular ac).
auto commitment_breaks() const -> const std::optional<std::vector<Real>>& noexcept
Planning default of Commitment.commitment_breaks (the daily commitment grid; unset: none).
auto constraint_mode() const -> auto noexcept
auto cvar_alpha() const -> double
CVaR tail level α (model_options.cvar_alpha, default 0.95).
auto cvar_weight() const -> double
CVaR weight λ (model_options.cvar_weight, default 0.5).
auto dc_line_reactance_threshold() const -> auto
Gets the per-unit reactance floor for zero-impedance ties.
auto dc_line_resistance_threshold() const -> auto
auto demand_fail_cost() const -> Real noexcept
Gets the demand failure cost [$/MWh] from model_options, falling back to default_demand_fail_cost (1000 $/MWh) when unset.
auto demand_fail_rhs_shift() const -> bool
auto demand_fail_segments() const -> std::span<const ScalarFailSegment> noexcept
Global default stepwise demand-failure curve (empty span when unset). See ModelOptions::demand_fail_segments.
auto dlr_limit_mode() const -> std::optional<LineDlrLimitMode>
auto drop_element_collections() const -> bool noexcept
auto effective_low_memory() const -> LowMemoryMode
auto equilibration_method() const -> auto noexcept
auto fast_start_max_hours() const -> double
auto gas_options() const -> const GasOptions& noexcept
Network-level gas properties (options.gas_options).
auto has_cascade_levels() const -> bool noexcept
Whether the user specified cascade levels.
auto hydro_spill_cost() const -> auto
Gets the hydro spill cost from model_options. Renamed from hydro_fail_cost per §11.10; legacy spelling still accepted as a JSON alias via the naming-dialects registry.
auto hydro_use_value() const -> auto
Gets the hydro use value (benefit per m³) from model_options.
auto input_directory() const -> auto
Gets the input directory path, using default if not set.
auto input_format() const -> std::string_view
Gets the input file format, using default if not set.
auto input_format_enum() const -> DataFormat
Gets the input file format as a typed enum.
auto is_emissions_objective() const -> bool
True when model_options.objective_mode = "emissions" — the LP should minimize Σ (emission_rate × generation) instead of dispatch cost. See ModelOptions::objective_mode (issue #519).
auto is_phase_continuous(int phase_index) const -> bool
Whether a given phase should use continuous LP relaxation. Parses the continuous_phases string from model_options using PhaseRangeSet.
auto kappa_enabled() const -> bool
Whether kappa is queried and reported at all.
auto kirchhoff_mode() const -> KirchhoffMode
Gets the Kirchhoff Voltage Law formulation.
auto kirchhoff_threshold() const -> auto
Gets the Kirchhoff threshold.
auto kvl_row_factor(double x_tau) const -> double
Post-equilibration factor c for a node-angle KVL row of a line with x_tau = X/V^2 (see LpMatrixOptions::kvl_row_scale). 1 when the option is off or no reference is available.
auto line_direction_mode() const -> LineDirectionMode
Radial-line detection mode (LineDirectionMode).
auto line_losses_mode() const -> LineLossesMode
Gets the line losses mode, with backward-compat fallback.
auto line_thermal_limit_mode() const -> LineThermalLimitMode
Gets the global line thermal-limit mode.
auto log_directory() const -> std::string
Gets the log directory for log/trace files.
auto long_transition() const -> const OptName& noexcept
Planning default of Commitment.long_transition (unset: undeclared long cyclic units are a validation error).
auto loss_cost_eps() const -> auto
Gets the per-MWh cost on the per-direction loss columns.
auto loss_flow_abs_cost() const -> auto
Gets the per-MWh pin cost on the tangent_signed_flow abs-flow proxy columns.
auto loss_overflow_cost() const -> double
Gets the price ($/MWh) on the loss carried by the overflow tier of a decoupled loss_envelope.
auto loss_overflow_cost_is_fallback() const -> bool
True when loss_overflow_cost() resolves to the 1000 $/MWh fallback (no explicit value and an effective demand_fail_cost() that is not positive, i.e. an explicit demand_fail_cost: 0).
auto loss_secant_segments() const -> auto
Gets the global default for Line.loss_secant_segments (issue #504 L-secant chord — number of segment columns per (line, block) emitted by tangent_signed_flow when the SOS2 L-secant chord is active). Per-line override beats this value; 1 (single-secant chord) preserves pre-#504 behaviour.
auto loss_segment_bound() const -> auto
Ordered-fill cap on PWL loss segments (model_options.loss_segment_bound, default true).
auto loss_segments() const -> auto
Gets the number of piecewise-linear loss segments.
auto loss_use_sos2() const -> auto
Gets the global default for Line.loss_use_sos2 (issue #504 — SOS2 enforcement on the L-secant segment columns). Per-line override beats this value; false preserves pre-#504 behaviour (no SOS2 declared even when loss_secant_segments > 1).
auto lp_coeff_ratio_threshold() const -> auto
Gets the LP coefficient ratio threshold for conditioning diagnostics.
auto lp_compression() const -> std::string_view
Gets the LP compression codec for debug LP files as a string.
auto lp_compression_enum() const -> std::optional<CompressionCodec>
Gets the LP compression codec as a typed enum (nullopt = inherit).
auto lp_debug() const -> auto
Gets the LP debug flag, using default if not set.
auto lp_debug_phase_max() const -> OptInt
Maximum phase UID for selective LP debug saving (nullopt = no filter).
auto lp_debug_phase_min() const -> OptInt
Minimum phase UID for selective LP debug saving (nullopt = no filter).
auto lp_debug_scene_max() const -> OptInt
Maximum scene UID for selective LP debug saving (nullopt = no filter).
auto lp_debug_scene_min() const -> OptInt
Minimum scene UID for selective LP debug saving (nullopt = no filter).
auto lp_error() const -> auto
auto lp_fingerprint() const -> auto
Gets the lp_fingerprint flag, using default if not set.
auto lp_only() const -> auto
Gets the lp_only flag, using default if not set.
auto lp_reduction() const -> bool
Whether SOURCE elements eliminate their provably-zero LP columns/rows. Default false — the un-reduced LP is the honest model, and a strong solver presolve reduces it to the same core. Enable with --lp-reduction (or model_options.lp_reduction = true) for weak-presolve backends (CLP / CBC / HiGHS) that benefit from the smaller LP up front. See ModelOptions::lp_reduction.
auto lp_scales() const -> auto
Gets the lp_scales level, using default (none) if not set.
auto lp_solver_name() const -> const std::string& noexcept
auto max_overload_ratio() const -> double noexcept
model_options.max_overload_ratio (default 1.5).
auto method_type_enum() const -> MethodType
Solver type as an enum (MethodType::monolithic or MethodType::sddp).
auto mip_start_options() const -> MipStartOptions
auto monolithic_solve_mode_enum() const -> SolveMode
Monolithic solve mode as an enum.
auto monolithic_solver_options() const -> SolverOptions
Gets the effective monolithic solver options.
auto mva_polygon_sides() const -> int
Sides of the line MVA polygon under LinDistFlow (0 = none).
auto network_model() const -> NetworkModel
Network power-flow model (model_options.network_model).
auto outage_reserve_mode() const -> OutageReserveMode
auto output_compression() const -> std::string_view
Gets the output compression codec as a string name.
auto output_compression_enum() const -> CompressionCodec
Gets the output compression codec as a typed enum.
auto output_directory() const -> auto
Gets the output directory path, using default if not set.
auto output_format() const -> std::string_view
Gets the output file format as a string name.
auto output_format_enum() const -> DataFormat
Gets the output file format as a typed enum.
auto output_round_decimals() const -> int noexcept
auto output_usage_metrics() const -> bool noexcept
auto overload_slack_bound() const -> LineOverloadSlackBound noexcept
model_options.overload_slack_bound (default thermal).
auto periodic_storage() const -> bool noexcept
auto pool_max_process_swap_mb() const -> auto
Work-pool process-VmSwap cap in MB (0 = gate off).
auto pool_swap_growth_mb() const -> auto
VmSwap growth (MB per window) that counts as active swapping.
auto prev_stage_link() const -> PrevStageLink
Gets the <attr>_prev stage-boundary link.
auto pricing_mode() const -> PricingMode
auto ramp_central2() const -> bool
Ramp discretisation: true for ramp_formula = "central2" (opt-in, second-order non-uniform derivative), false for the default "backward" interval slope (block and point stages alike). See ModelOptions::ramp_formula.
auto ramp_wrap() const -> bool
central2 ramps wrap cyclically over the stage period.
auto reserve_shortage_cost() const -> auto
Gets the reserve shortage cost from model_options. Renamed from reserve_fail_cost per §11.10; legacy spelling still accepted as a JSON alias via the naming-dialects registry.
auto resolve_lp_matrix_options(LpMatrixOptions explicit_opts) const -> LpMatrixOptions
auto risk_measure() const -> RiskMeasure
auto risk_rank_by() const -> RiskRankBy
auto risk_tail() const -> RiskTail
auto scale_loss_link() const -> auto
Gets the row-scale factor for the line-loss linking row.
auto scale_objective() const -> auto
Gets the objective function scaling factor.
auto scale_theta() const -> auto
Gets the voltage-angle enlargement factor.
auto sddp_alpha_min() const -> OptReal
Optional universal α floor (sddp_options.alpha_min), unset = none.
auto sddp_aperture_chunk_mode() const -> std::optional<ApertureChunkMode> noexcept
auto sddp_aperture_chunk_size() const -> auto noexcept
auto sddp_aperture_cut_resolve() const -> auto
Whether the aperture backward path re-solves the source LP after installing its cut (optimality check).
auto sddp_aperture_directory() const -> Name
auto sddp_aperture_screen_count() const -> auto noexcept
auto sddp_aperture_seed_basis() const -> auto
auto sddp_aperture_selection_mode() const -> ApertureSelectionMode
auto sddp_aperture_solve_mode() const -> auto noexcept
auto sddp_aperture_system_file() const -> Name
auto sddp_aperture_timeout() const -> auto
Aperture LP timeout in seconds.
auto sddp_aperture_use_manual_clone() const -> auto
auto sddp_apertures() const -> const auto& noexcept
auto sddp_api_enabled() const -> auto
Gets the SDDP monitoring API enabled flag, using default if not set.
auto sddp_backward_resolve_target() const -> auto
Whether the backward pass re-solves the target phase LP before extracting cut data.
auto sddp_backward_solver_options() const -> SolverOptions
Gets the effective SDDP backward-pass solver options.
auto sddp_basis_cross_mode() const -> auto noexcept
auto sddp_convergence_confidence() const -> auto
Gets the confidence level for statistical convergence.
auto sddp_convergence_mode() const -> auto
Gets the SDDP convergence mode.
auto sddp_convergence_tol() const -> auto
Gets the SDDP convergence tolerance.
auto sddp_cut_coeff_eps() const -> double
Gets the cut coefficient tolerance for filtering tiny coefficients.
auto sddp_cut_directory() const -> auto
Gets the cut directory for SDDP cut files, using default if not set.
auto sddp_cut_drain_mode() const -> CutDrainMode
Get the resolved cut-drain mode for the async SDDP path.
auto sddp_cut_prune_interval() const -> auto
Iterations between cut pruning passes. Default: 10.
auto sddp_cut_recovery_mode_enum() const -> HotStartMode
SDDP cut recovery mode as an enum.
auto sddp_cut_sharing_mode() const -> std::string_view
Gets the SDDP cut sharing mode as a string name.
auto sddp_cut_sharing_mode_enum() const -> CutSharingMode
Gets the SDDP cut sharing mode as a typed enum.
auto sddp_cuts_input_file() const -> Name
Gets the input cut file for SDDP hot-start.
auto sddp_elastic_mode() const -> std::string_view
Gets the elastic filter mode as a string name.
auto sddp_elastic_mode_enum() const -> ElasticFilterMode
Gets the elastic filter mode as a typed enum.
auto sddp_elastic_penalty() const -> auto
Gets the elastic slack penalty.
auto sddp_fact_eps() const -> double
Gets the PLP FactEPS tolerance for elastic_mode = state_repair (alias plp) / farkas_recursive.
auto sddp_fact_max_cycles() const -> int
Gets the PLP FactMXC solve-cycle cap for elastic_mode = state_repair (alias plp) / farkas_recursive.
auto sddp_fcut_log() const -> bool
Gets the PLP-style feasibility-cut debug log flag (gtopt_fcut.log in log_directory — the plpfact.log analogue; CLI shorthand --fcut-log).
auto sddp_forward_fail_stop() const -> auto
Whether the forward pass fail-stops at the scene level instead of cascading backward through phases (default: true).
auto sddp_forward_infeas_rollback() const -> auto
Whether per-scene infeasibility rollback is enabled.
auto sddp_forward_sampling_mode_enum() const -> ForwardSamplingMode
Gets the SDDP forward sampling mode as a typed enum.
auto sddp_forward_solver_options() const -> SolverOptions
Gets the effective SDDP forward-pass solver options.
auto sddp_free_solver_scratch() const -> bool noexcept
auto sddp_integer_cuts_mode_enum() const -> IntegerCutsMode
Gets the SDDP integer-cut mode as a typed enum.
auto sddp_low_memory() const -> LowMemoryMode
auto sddp_lp_debug_passes() const -> std::string_view
Comma-separated SDDP passes whose LP-debug dump is active when lp_debug=true. Empty / unset defaults to "forward,aperture" (legacy).
auto sddp_markov_states() const -> std::vector<int>
auto sddp_markov_transition() const -> std::vector<double>
auto sddp_max_async_spread() const -> auto
Maximum async iteration spread (default: 0 = synchronous).
auto sddp_max_cuts_per_phase() const -> auto
Maximum retained cuts per (scene, phase) LP. 0 = unlimited (default).
auto sddp_max_iterations() const -> auto
Gets the maximum SDDP iterations.
auto sddp_max_stored_cuts() const -> auto
Maximum stored cuts per scene. Default: 0 (unlimited).
auto sddp_memory_codec() const -> auto
In-memory compression codec for low_memory level 2.
auto sddp_min_iterations() const -> auto
Gets the minimum SDDP iterations before convergence.
auto sddp_multi_cut_threshold() const -> auto
Gets the multi_cut threshold.
auto sddp_num_apertures() const -> const auto& noexcept
auto sddp_pool_cpu_factor() const -> auto
SDDP work pool CPU over-commit factor (default: 4.0).
auto sddp_pool_cpu_factor_is_set() const -> bool
Whether the user explicitly set the SDDP pool CPU factor.
auto sddp_pool_memory_limit_mb() const -> auto
SDDP work pool memory limit in MB (0 = no limit).
auto sddp_prune_dual_threshold() const -> auto
Dual threshold for inactive cut detection. Default: 1e-8.
auto sddp_recovery_mode_enum() const -> RecoveryMode
SDDP recovery mode as an enum.
auto sddp_release_after_alpha() const -> bool noexcept
Whether aperture clones bypass the backend's native clone() and are built via LinearInterface::clone_from_flat() instead (manual route, no global mutex).
auto sddp_release_backends() const -> bool noexcept
auto sddp_save_aperture_lp() const -> auto
Whether to save LP files for infeasible apertures.
auto sddp_save_per_iteration() const -> auto
Whether to save cuts after each iteration (default: true).
auto sddp_scale_alpha() const -> auto
Gets the scale divisor for future cost variable α
auto sddp_sentinel_file() const -> Name
Gets the sentinel file path for graceful SDDP stop.
auto sddp_simulation_mode() const -> auto
Simulation mode: no training iterations, forward-only pass.
auto sddp_single_cut_storage() const -> auto
Use single cut storage (per-scene only). Default: false.
auto sddp_state_variable_lookup_mode() const -> auto
How update_lp elements obtain reservoir/battery volume between phases (affects seepage, production factor, discharge limit only). Default: warm_start (no cross-phase lookup).
auto sddp_stationary_gap_ceiling() const -> auto
Gets the absolute gap ceiling for the secondary convergence tests.
auto sddp_stationary_tol() const -> auto
Gets the stationary-gap convergence tolerance.
auto sddp_stationary_window() const -> auto
Gets the look-back window for stationary gap detection.
auto sddp_terminal_failure_threshold() const -> auto
Gets the consecutive-structural-failure threshold for terminal-skip.
auto sddp_update_lp_skip() const -> auto
Gets the global update_lp skip count.
void set_output_directory(std::string dir)
auto solver_options() const -> const SolverOptions& noexcept
Gets the global LP solver options sub-object.
auto startup_tier_integrality() const -> StartupTierIntegrality
auto state_violation_cost() const -> auto
Gets the state failure cost from model_options [$/MWh].
auto storage_integration() const -> StorageIntegration
Global storage-balance integration rule (storage_integration) of a POINT-sampled stage (block stages always use the block recursion): block by default.
auto storage_integration(const OptName& element, bool reservoir) const -> StorageIntegration
Point-stage integration rule of one storage element: element value → per-type option (reservoir_storage_integration / battery_storage_integration) → global storage_integration → built-in per-type default (lg4_pos for reservoirs, block).
auto strict_storage_emin() const -> auto
Whether to enforce the per-stage emin floor as a HARD lower bound on the storage sini and last-block efin columns.
auto theta_max() const -> auto
Gets the bound for voltage-angle variables (θ ∈ [−theta_max, +theta_max]).
auto tie_line_losses() const -> auto
Whether zero-impedance ties keep their loss model.
auto tiny_reactance_mode() const -> TinyReactanceMode
auto tiny_reactance_rel_threshold() const -> auto
Gets the treatment of nonzero sub-threshold reactances.
auto transition_integrality() const -> TransitionIntegrality
auto uc_power_based() const -> bool
Global UC formulation is "power_based" (default "energy_block"). See ModelOptions::uc_formulation.
auto use_kirchhoff() const -> auto
Gets the Kirchhoff constraints flag. The DC Kirchhoff (B–θ / cycle-basis) rows. Off under network_model = "lindistflow", whose voltage-drop rows replace them.
auto use_lindistflow() const -> bool
True under network_model = "lindistflow" on a multi-bus network.
auto use_line_dlr() const -> bool noexcept
auto use_line_losses() const -> auto deprecated
Gets the line loss modeling flag from model_options.
auto use_single_bus() const -> auto
Gets the single-bus modeling flag.
auto use_uid_fname() const -> auto
Gets the UID filename usage flag, using default if not set.
auto variable_scale_map() const -> const auto& noexcept
Gets the variable scale map built from variable_scales entries.
auto write_out() const -> OutputSelection noexcept

Function documentation

static std::vector<std::string> gtopt::PlanningOptionsLP::validate_enum_options()

Validate all enum-typed option fields and return a list of warnings.

Since enum fields are now typed (std::optional<EnumType>), invalid JSON strings are silently dropped to nullopt during parsing. This method detects those cases and reports them. Callers should log warnings at an appropriate level (typically WARN).

gtopt::PlanningOptionsLP::PlanningOptionsLP(PlanningOptions poptions = {}) explicit

Constructs a PlanningOptionsLP wrapper around a PlanningOptions object.

Parameters
poptions The PlanningOptions object to wrap (defaults to empty)

auto gtopt::PlanningOptionsLP::annual_discount_rate() const

Gets the annual discount rate, using default if not set.

Returns The annual discount rate for multi-year planning

Gets the annual discount rate (deprecated flat field fallback). Canonical location is simulation.annual_discount_rate.

auto gtopt::PlanningOptionsLP::battery_annual_standing_loss() const

Resolved default self-discharge [p.u./year] for batteries whose own annual_standing_loss is unset. See default_battery_annual_standing_loss.

bool gtopt::PlanningOptionsLP::battery_power_envelope() const

Whether battery converters emit the power-envelope valid inequality p_c/Pc_max + p_d/Pd_max ≤ 1 per block. Default true. See ModelOptions::battery_power_envelope.

BuildMode gtopt::PlanningOptionsLP::build_mode_enum() const

LP-build mode as an enum. Defaults to scene_parallel — the pre-00c605d7 per-scene work-pool submission (coarse granularity, lower pool/malloc-arena contention). Users may opt into full_parallel via --build-mode full-parallel for maximum concurrency, or serial for a genuine in-thread baseline.

auto gtopt::PlanningOptionsLP::build_pool_cpu_factor() const

LP-build work-pool CPU over-commit factor (default: 2.0).

Currently shares the sddp_options.pool_cpu_factor field with the SDDP pool so that a single --cpu-factor CLI flag controls both pools uniformly. When the user does not set --cpu-factor, the LP-build pool falls back to a more conservative 2.0× factor (vs the SDDP pool's 4.0×) — reflecting that LP build is memory- heavy (constructing full SystemLP trees) while SDDP solving is CPU-bound (solver calls). When the CLI flag is set, both pools pick it up and the user can force a 1-thread serial baseline via --cpu-factor 0.025 on a typical 20-core box.

auto gtopt::PlanningOptionsLP::cascade_write_level_outputs() const noexcept

Whether intermediate cascade levels write their own output set (cascade_options.write_level_outputs, default false).

auto gtopt::PlanningOptionsLP::constraint_mode() const noexcept

Controls error handling for user constraint resolution. Default is strict — fail on any unresolved reference.

auto gtopt::PlanningOptionsLP::dc_line_reactance_threshold() const

Gets the per-unit reactance floor for zero-impedance ties.

Returns the resolved threshold below which a line's |X/V²| loses its KVL flow term: a zero-impedance tie under tiny_reactance_mode = tie, a DC link (X rewritten to 0 by PlanningLP::validate_line_reactance) under dc.

auto gtopt::PlanningOptionsLP::dc_line_resistance_threshold() const

Returns the resolved threshold used by PlanningLP::validate_line_resistance when deciding whether a line's |R/V²| is small enough to warrant rewriting R to 0 (and thus dropping the line's quadratic loss model).

bool gtopt::PlanningOptionsLP::demand_fail_rhs_shift() const

Demand-failure substitution with RHS shift (Option C — renamed from demand_option_c per §11.10 of docs/analysis/naming-conventions.md). Default false (Option A: obj_constant baseline). See ModelOptions::demand_fail_rhs_shift for the full rationale.

std::optional<LineDlrLimitMode> gtopt::PlanningOptionsLP::dlr_limit_mode() const

model_options.dlr_limit_mode: how a Line.dlr rating combines with the static limits. nullopt when unset (each line then picks replace with a conductor_rating_*, else min). Unknown names are rejected by validate_planning.

bool gtopt::PlanningOptionsLP::drop_element_collections() const noexcept

lp_matrix_options.drop_element_collections (default true): SDDP / cascade under low_memory = off drop the disposable element collections after the build and rebuild them for write_out.

LowMemoryMode gtopt::PlanningOptionsLP::effective_low_memory() const

The low_memory mode the run actually uses: off for the monolithic method (one solve sequence per cell — PlanningLP forces the mode off there), sddp_low_memory() otherwise. Post-solve diagnostics must judge the run against this, not the SDDP default.

auto gtopt::PlanningOptionsLP::equilibration_method() const noexcept

The matrix equilibration method to use — the single source of the default, shared by the production runner (gtopt_lp_runner.cpp) and every directly constructed PlanningLP / SystemLP (via resolve_lp_matrix_options).

User-supplied JSON options.lp_matrix_options.equilibration_method = "ruiz" | "row_max" | "none" always takes precedence. When unset the default depends on network topology:

  • Multi-bus Kirchhoff → ruiz (heterogeneous reactance × tmax ratios across lines create wide row/column magnitude spread that ruiz iteration tames).
  • Single-bus or copper-plate → row_max.

Note: commit 63b36e677 (2026-05) switched the single-bus default of this accessor to none after a large hydrothermal kappa benchmark (iter-15 kappa 1.27e8 → 8.10e7), but the accessor was never called — production kept its own row_max copy of the policy. The production behaviour (row_max) is what is resolved here; set equilibration_method: none explicitly for the benchmarked single-bus configuration.

double gtopt::PlanningOptionsLP::fast_start_max_hours() const

Auto-rule threshold [h] for fast-start commitments (model_options.fast_start_max_hours, default 1 h).

auto gtopt::PlanningOptionsLP::hydro_spill_cost() const

Gets the hydro spill cost from model_options. Renamed from hydro_fail_cost per §11.10; legacy spelling still accepted as a JSON alias via the naming-dialects registry.

UNIT: returned in [$/m³] (per-volume), matching the documentation on ModelOptions::hydro_spill_cost. Callers pricing a flow column [m³/s] via CostHelper::block_ecost(...) (which multiplies by block duration [h]) MUST lift the value by × 3600 to convert to [$/(m³/s)/h] — see flow_right_lp.cpp:396 for the reference pattern. Direct volume-based costs ($/m³ × m³) need no conversion.

auto gtopt::PlanningOptionsLP::hydro_use_value() const

Gets the hydro use value (benefit per m³) from model_options.

UNIT: returned in [$/m³] (per-volume, like hydro_spill_cost). Same × 3600 lift required when used as a fallback for a flow-column benefit [$/(m³/s)/h] — see flow_right_lp.cpp:471 and the parallel comment on hydro_spill_cost() above.

auto gtopt::PlanningOptionsLP::input_directory() const

Gets the input directory path, using default if not set.

Returns The input directory path

std::string_view gtopt::PlanningOptionsLP::input_format() const

Gets the input file format, using default if not set.

Returns The input file format as a string name

DataFormat gtopt::PlanningOptionsLP::input_format_enum() const

Gets the input file format as a typed enum.

Returns The input DataFormat enum value

bool gtopt::PlanningOptionsLP::kappa_enabled() const

Whether kappa is queried and reported at all.

False only when every solve's kappa_mode resolves to off (solver_options, the SDDP forward / backward and the monolithic pass options; unset falls back to $GTOPT_KAPPA_MODE, then the compiled default). Then no kappa column is written to solution.csv, and no kappa appears in logs or stats.

KirchhoffMode gtopt::PlanningOptionsLP::kirchhoff_mode() const

Gets the Kirchhoff Voltage Law formulation.

Priority: model_options.kirchhoff_mode (string) → default_kirchhoff_mode (node_angle). An unrecognised string falls back to the default.

LineDirectionMode gtopt::PlanningOptionsLP::line_direction_mode() const

Radial-line detection mode (LineDirectionMode).

Priority: model_options.line_direction_mode (string) → default_line_direction_mode (off). An unknown name falls back to the default. Per-line Line.flow_direction overrides it.

LineLossesMode gtopt::PlanningOptionsLP::line_losses_mode() const

Gets the line losses mode, with backward-compat fallback.

Priority: model_options.line_losses_mode (string) → model_options.use_line_losses (bool, deprecated) → default_line_losses_mode (adaptive).

LineThermalLimitMode gtopt::PlanningOptionsLP::line_thermal_limit_mode() const

Gets the global line thermal-limit mode.

Priority: model_options.line_thermal_limit_mode (string) → default_line_thermal_limit_mode (flow). An unknown name also resolves to the default. Per-line Line.line_thermal_limit_mode overrides this value.

std::string gtopt::PlanningOptionsLP::log_directory() const

Gets the log directory for log/trace files.

Returns The log directory path (global — used by both monolithic and SDDP)

When log_directory is explicitly set in the JSON / CLI, that value is used as-is. Otherwise the default is output_directory + "/logs" so that all solver output (results, cuts, logs) is consolidated under a single root directory.

auto gtopt::PlanningOptionsLP::loss_cost_eps() const

Gets the per-MWh cost on the per-direction loss columns.

Returns the resolved global loss_cost_eps ($/MWh) applied to every PWL/bidirectional line's loss_p/loss_n column to strictly break the LP-relax bidirectional-flow degeneracy. When unset, returns default_loss_cost_eps (0.1 $/MWh); an explicit 0 disables it. Per-line Line.loss_cost_eps overrides this value when present.

auto gtopt::PlanningOptionsLP::loss_flow_abs_cost() const

Gets the per-MWh pin cost on the tangent_signed_flow abs-flow proxy columns.

Returns model_options.loss_flow_abs_cost ($/MWh) when set, else default_loss_flow_abs_cost (0.001 $/MWh); 0 disables the pin. Per-line Line.loss_flow_abs_cost overrides.

double gtopt::PlanningOptionsLP::loss_overflow_cost() const

Gets the price ($/MWh) on the loss carried by the overflow tier of a decoupled loss_envelope.

Resolution: an explicit model_options.loss_overflow_cost (0 disables the guard) wins; unset → the case's own global demand_fail_cost() (burning a MWh in the tier is then never cheaper than shedding one — e.g. the PLEXOS VoLL 467.19 $/MWh in CEN PCP cases; default_demand_fail_cost = 1000 $/MWh when model_options.demand_fail_cost is unset); if that is ≤ 0 (an explicit demand_fail_cost: 0) → default_demand_fail_cost (1000 $/MWh; see loss_overflow_cost_is_fallback). Per-demand Demand.fcost overrides are deliberately NOT consulted: the price belongs to a line, not to any one demand, and the global value is the case's reference VoLL. Per-line Line.loss_overflow_cost overrides.

auto gtopt::PlanningOptionsLP::lp_coeff_ratio_threshold() const

Gets the LP coefficient ratio threshold for conditioning diagnostics.

Returns The threshold above which per-scene/phase LP stats are shown (default 1e7).

std::string_view gtopt::PlanningOptionsLP::lp_compression() const

Gets the LP compression codec for debug LP files as a string.

Returns Compression codec string (may be empty = inherit)

Returns the codec name when set, or empty string (the default) meaning "inherit from output_compression". "uncompressed" disables LP compression regardless of output_compression.

std::optional<CompressionCodec> gtopt::PlanningOptionsLP::lp_compression_enum() const

Gets the LP compression codec as a typed enum (nullopt = inherit).

Returns The CompressionCodec enum value, or nullopt

auto gtopt::PlanningOptionsLP::lp_debug() const

Gets the LP debug flag, using default if not set.

Returns Whether to save debug LP files to the log directory

auto gtopt::PlanningOptionsLP::lp_error() const

When true, write an error LP file on cell infeasibility and keep the name metadata needed for it (independent of lp_debug).

auto gtopt::PlanningOptionsLP::lp_fingerprint() const

Gets the lp_fingerprint flag, using default if not set.

Returns Whether to write LP fingerprint files

When true, write LP fingerprint JSON to the output directory after LP assembly. The fingerprint captures the structural template (which types of variables/constraints exist) for regression detection.

auto gtopt::PlanningOptionsLP::lp_only() const

Gets the lp_only flag, using default if not set.

Returns Whether to stop after LP building

When true, the solver builds all scene×phase LP matrices but skips solving entirely. Applies uniformly to both the monolithic solver and the SDDP solver: exit right after LP assembly with no solve at all. Combine with lp_debug=true to save every scene/phase LP file to disk.

auto gtopt::PlanningOptionsLP::lp_scales() const

Gets the lp_scales level, using default (none) if not set.

Returns Content of the LP scales sidecars (none = not written)

When true, every LP file written via --lp-file is accompanied by a JSON sidecar (<stem>.scales.json) with its objective scale, block weights and scaled columns/rows.

const std::string& gtopt::PlanningOptionsLP::lp_solver_name() const noexcept

Solver backend pinned at the planning level via options.lp_matrix_options.solver_name (programmatic API — the field is not JSON-mapped). Empty = no pin; callers fall through to SolverRegistry::default_solver() (GTOPT_SOLVER env / priority).

MipStartOptions gtopt::PlanningOptionsLP::mip_start_options() const

Initial-MIP-solution (warm-start) options for the monolithic solver. Returns the configured MipStartOptions or a default (all-unset, i.e. the feature off) when none was supplied.

SolverOptions gtopt::PlanningOptionsLP::monolithic_solver_options() const

Gets the effective monolithic solver options.

Returns Resolved SolverOptions for the monolithic solver

Merges the per-method monolithic solver options (if set) with the global solver_options. Per-method options override the global ones.

NetworkModel gtopt::PlanningOptionsLP::network_model() const

Network power-flow model (model_options.network_model).

Unset or unknown → dc (today's LP).

OutageReserveMode gtopt::PlanningOptionsLP::outage_reserve_mode() const

Post-MIP pricing method (model_options.pricing_mode). Unset or an unrecognised name resolves to PricingMode::fixed (validation rejects unknown names up front). Reserve reaction to Generator.outage_fraction (model_options.outage_reserve_mode); unset / unknown = none.

std::string_view gtopt::PlanningOptionsLP::output_compression() const

Gets the output compression codec as a string name.

Returns The compression codec name for output files

CompressionCodec gtopt::PlanningOptionsLP::output_compression_enum() const

Gets the output compression codec as a typed enum.

Returns The CompressionCodec enum value

auto gtopt::PlanningOptionsLP::output_directory() const

Gets the output directory path, using default if not set.

Returns The output directory path

std::string_view gtopt::PlanningOptionsLP::output_format() const

Gets the output file format as a string name.

Returns The output file format name

DataFormat gtopt::PlanningOptionsLP::output_format_enum() const

Gets the output file format as a typed enum.

Returns The output DataFormat enum value

bool gtopt::PlanningOptionsLP::output_usage_metrics() const noexcept

options.output_usage_metrics (default false): emit the per-block usage-accounting streams (Generator/usage_on, Generator/usage_ramp, Commitment/usage_pmin, Commitment/usage_at_pmin). Output only; the LP is unchanged.

bool gtopt::PlanningOptionsLP::periodic_storage() const noexcept

model_options.periodic_storage (default false): storages wrap / run one real cycle on periodic stages (see ModelOptions).

auto gtopt::PlanningOptionsLP::pool_max_process_swap_mb() const

Work-pool process-VmSwap cap in MB (0 = gate off).

The pool throttles dispatch only while VmSwap is at/above this AND growing by more than pool_swap_growth_mb() per window.

PrevStageLink gtopt::PlanningOptionsLP::prev_stage_link() const

Gets the <attr>_prev stage-boundary link.

Priority: model_options.prev_stage_link (string) → default_prev_stage_link (stage). Unknown names are rejected by validate_planning.

LpMatrixOptions gtopt::PlanningOptionsLP::resolve_lp_matrix_options(LpMatrixOptions explicit_opts) const

Resolve the effective LpMatrixOptions for an LP build.

Every user-facing optional field left unset in explicit_opts (equilibration_method, fast_sqrt_method, ruiz_max_iterations, ruiz_tolerance, compute_stats, lp_coeff_ratio_threshold, validation) is filled from options.lp_matrix_options; an explicit field wins only when set. options.lp_fingerprint turns on compute_fingerprint. A still-unset equilibration_method then takes the topology default of equilibration_method(). Applied by SystemLP::create_lp, so production (gtopt_lp_runner), cascade levels, aperture systems and directly constructed PlanningLP / SystemLP (unit tests) all build with the same options.

RiskMeasure gtopt::PlanningOptionsLP::risk_measure() const

Risk measure of the scenario costs (model_options.risk_measure). Unset or unknown → RiskMeasure::expected (validation rejects unknown names up front).

RiskRankBy gtopt::PlanningOptionsLP::risk_rank_by() const

Tail ranking of the risk measure (model_options.risk_rank_by, default cost).

RiskTail gtopt::PlanningOptionsLP::risk_tail() const

Tail side of the risk measure (model_options.risk_tail, default upper).

auto gtopt::PlanningOptionsLP::scale_loss_link() const

Gets the row-scale factor for the line-loss linking row.

Returns the resolved factor used by line_losses to multiply both lossrow[loss_col] and lossrow[seg_col] so the smallest segment coefficient seg_width · R · 1 / V² is lifted into a numerically tractable range. When auto_scale=true (default) and the option is unset, PlanningLP::auto_scale_loss_link computes a power-of-10 multiplier from median(R/V²); otherwise the fallback is 1.0 (no scaling).

auto gtopt::PlanningOptionsLP::scale_objective() const

Gets the objective function scaling factor.

Default depends on planning method:

  • SDDP / cascade : 1.0 (numerical-conditioning win per the large hydrothermal case benchmark — see default_scale_objective doc).
  • Monolithic : 1000 (legacy default; preserves existing test fixtures and single-shot LP behaviour).

User-supplied model_options.scale_objective always takes precedence.

auto gtopt::PlanningOptionsLP::scale_theta() const

Gets the voltage-angle enlargement factor.

θ_LP = scale_theta · θ (rad): 1 = radians, 1000 = milliradians. Auto (when unset and auto_scale) = 1 / (3 · median(X/V²)). The Bus.theta VariableScale entry is its reciprocal.

std::optional<ApertureChunkMode> gtopt::PlanningOptionsLP::sddp_aperture_chunk_mode() const noexcept

Aperture task grouping as configured (nullopt = not set; the default per_scene — or the mode implied by the legacy integer aperture_chunk_size — is resolved at SDDPMethod setup by resolve_aperture_chunk()). See SddpOptions::aperture_chunk_mode.

auto gtopt::PlanningOptionsLP::sddp_aperture_chunk_size() const noexcept

Apertures per task for aperture_chunk_mode = chunked (0 = unset). When the mode is unset the legacy integer encoding still selects it (-1 → per_scene, 1 → per_aperture, K > 1 → chunked K; 0 → default per_scene). See SddpOptions::aperture_chunk_size.

auto gtopt::PlanningOptionsLP::sddp_aperture_cut_resolve() const

Whether the aperture backward path re-solves the source LP after installing its cut (optimality check).

Returns aperture_cut_resolve (default: false).

Name gtopt::PlanningOptionsLP::sddp_aperture_directory() const

Directory for aperture-specific scenario data (empty = use input_directory)

auto gtopt::PlanningOptionsLP::sddp_aperture_screen_count() const noexcept

Number of dual-shared aperture cuts re-solved exactly under aperture_solve_mode = screened (picked by largest |intercept correction|). Ignored by every other mode. Default default_sddp_aperture_screen_count (2, sddp_enums.hpp — the single source). See SddpOptions::aperture_screen_count.

auto gtopt::PlanningOptionsLP::sddp_aperture_seed_basis() const

Whether to seed each iteration's first backward aperture from the previous iteration's first-aperture basis (dual warm start). Default false — meaningful for every basis-capable (vertex) mode, i.e. all aperture_solve_modes except reduced_cost.

ApertureSelectionMode gtopt::PlanningOptionsLP::sddp_aperture_selection_mode() const

Selection rule used by num_apertures (head | stride | tail). Returns the parsed enum value; defaults to head when the option is unset.

auto gtopt::PlanningOptionsLP::sddp_aperture_solve_mode() const noexcept

Aperture solve / cut-recovery mode. Default warm (within-chunk dual-simplex warm chain off the resident basis; combined with the default basis_cross_mode = full_cross below, the chunk's first aperture is dual-seeded from the forward basis). plp2gtopt also emits warm explicitly. See SddpOptions::aperture_solve_mode.

Name gtopt::PlanningOptionsLP::sddp_aperture_system_file() const

Global default aperture-system file (the simplified backward system solved per aperture). Empty = no global aperture system; the per-phase / per-cascade-level overrides still apply. See SddpOptions::aperture_system_file.

auto gtopt::PlanningOptionsLP::sddp_aperture_timeout() const

Aperture LP timeout in seconds.

Returns Aperture timeout in seconds (default 30 s; 0 = no limit)

const auto& gtopt::PlanningOptionsLP::sddp_apertures() const noexcept

Aperture UIDs for the backward pass. nullopt = use per-phase apertures; empty = no apertures (Benders).

auto gtopt::PlanningOptionsLP::sddp_api_enabled() const

Gets the SDDP monitoring API enabled flag, using default if not set.

Returns Whether the SDDP monitoring API is enabled (default: true)

auto gtopt::PlanningOptionsLP::sddp_backward_resolve_target() const

Whether the backward pass re-solves the target phase LP before extracting cut data.

Returns true if backward_resolve_target is enabled (default: true).

SolverOptions gtopt::PlanningOptionsLP::sddp_backward_solver_options() const

Gets the effective SDDP backward-pass solver options.

Returns Resolved SolverOptions for SDDP backward pass

Merges the per-pass backward solver options (if set) with the global solver_options. Backward-pass-specific options take precedence. Applies backward_max_fallbacks (default: 0).

auto gtopt::PlanningOptionsLP::sddp_basis_cross_mode() const noexcept

Cross-pass simplex-basis warm-start reuse mode. Default full_cross (forward→forward warm reuse + forward basis fed into the backward/tgt and aperture solves). Combined with the seeded-solve auto-dual logic this makes every warm SDDP solve run dual simplex off a reused basis (cold iter-1 solves keep barrier to produce a capturable vertex basis). Convergence-safe (cuts stay valid vertex duals); on degenerate problems the trajectory can differ slightly from off while still converging. See SddpOptions::basis_cross_mode / BasisCrossMode.

auto gtopt::PlanningOptionsLP::sddp_convergence_confidence() const

Gets the confidence level for statistical convergence.

Returns Confidence level (0-1), 0.0 = disabled (default)

auto gtopt::PlanningOptionsLP::sddp_convergence_mode() const

Gets the SDDP convergence mode.

Returns ConvergenceMode enum (default: gap_stationary). The statistical CI test (ConvergenceMode::statistical) is opt-in — it relies on convergence_confidence > 0 and is too easily fooled by heterogeneous-scene σ scatter (Maule-type large cases). Gap + stationary safety net is the right default for most users.

auto gtopt::PlanningOptionsLP::sddp_convergence_tol() const

Gets the SDDP convergence tolerance.

Returns Relative gap tolerance for convergence (default: 1e-4)

double gtopt::PlanningOptionsLP::sddp_cut_coeff_eps() const

Gets the cut coefficient tolerance for filtering tiny coefficients.

Returns Absolute tolerance (default: 0.0 = no filtering)

auto gtopt::PlanningOptionsLP::sddp_cut_directory() const

Gets the cut directory for SDDP cut files, using default if not set.

Returns The cut directory path

CutDrainMode gtopt::PlanningOptionsLP::sddp_cut_drain_mode() const

Get the resolved cut-drain mode for the async SDDP path.

Default is CutDrainMode::iteration (symmetric, run-to-run deterministic). See CutDrainMode in sddp_enums.hpp for the full rationale and the comparison against count (legacy asymmetric) and all (no truncation).

std::string_view gtopt::PlanningOptionsLP::sddp_cut_sharing_mode() const

Gets the SDDP cut sharing mode as a string name.

Returns The cut sharing mode name

CutSharingMode gtopt::PlanningOptionsLP::sddp_cut_sharing_mode_enum() const

Gets the SDDP cut sharing mode as a typed enum.

Returns The CutSharingMode enum value

Name gtopt::PlanningOptionsLP::sddp_cuts_input_file() const

Gets the input cut file for SDDP hot-start.

Returns Cut file path or empty string for cold start

std::string_view gtopt::PlanningOptionsLP::sddp_elastic_mode() const

Gets the elastic filter mode as a string name.

Returns "chinneck" (default), "single_cut", or "multi_cut"

ElasticFilterMode gtopt::PlanningOptionsLP::sddp_elastic_mode_enum() const

Gets the elastic filter mode as a typed enum.

Returns The ElasticFilterMode enum value

auto gtopt::PlanningOptionsLP::sddp_elastic_penalty() const

Gets the elastic slack penalty.

Returns Penalty for elastic slack variables (default: 1e6)

double gtopt::PlanningOptionsLP::sddp_fact_eps() const

Gets the PLP FactEPS tolerance for elastic_mode = state_repair (alias plp) / farkas_recursive.

Returns fact_eps (default: 1e-8, PLP FactEPS parity)

int gtopt::PlanningOptionsLP::sddp_fact_max_cycles() const

Gets the PLP FactMXC solve-cycle cap for elastic_mode = state_repair (alias plp) / farkas_recursive.

Returns fact_max_cycles (default: 500, PLP FactMXC parity)

bool gtopt::PlanningOptionsLP::sddp_fcut_log() const

Gets the PLP-style feasibility-cut debug log flag (gtopt_fcut.log in log_directory — the plpfact.log analogue; CLI shorthand --fcut-log).

Returns Whether the fcut debug log is written (default: false)

auto gtopt::PlanningOptionsLP::sddp_forward_fail_stop() const

Whether the forward pass fail-stops at the scene level instead of cascading backward through phases (default: true).

Returns true if scene-level fail-stop is enabled.

auto gtopt::PlanningOptionsLP::sddp_forward_infeas_rollback() const

Whether per-scene infeasibility rollback is enabled.

Returns true if forward_infeas_rollback is enabled (default: true).

ForwardSamplingMode gtopt::PlanningOptionsLP::sddp_forward_sampling_mode_enum() const

Gets the SDDP forward sampling mode as a typed enum.

Returns The ForwardSamplingMode enum value

SolverOptions gtopt::PlanningOptionsLP::sddp_forward_solver_options() const

Gets the effective SDDP forward-pass solver options.

Returns Resolved SolverOptions for SDDP forward pass

Merges the per-pass forward solver options (if set) with the global solver_options. Forward-pass-specific options take precedence.

bool gtopt::PlanningOptionsLP::sddp_free_solver_scratch() const noexcept

sddp_options.free_solver_scratch (default true). Free the CPLEX / Gurobi / MindOpt copy-out getter scratch after each solve under low_memory = off (false: keep it, the previous behaviour).

IntegerCutsMode gtopt::PlanningOptionsLP::sddp_integer_cuts_mode_enum() const

Gets the SDDP integer-cut mode as a typed enum.

Returns The IntegerCutsMode enum value

LowMemoryMode gtopt::PlanningOptionsLP::sddp_low_memory() const

Low memory mode: off or compress (default for SDDP/cascade). Resolved default is compress so SDDP/cascade runs release the solver backend between solves and keep an in-memory compressed flat-LP snapshot. Set explicitly to LowMemoryMode::off (or --memory-saving off) to keep the solver backend resident — typically only needed for debugging the backend across solves.

Environment override: GTOPT_MEMORY_MODE=normal|compress forces the mode GLOBALLY, taking precedence over the per-run option. normal (aliases off/uncompress) keeps the backend resident with an uncompressed flat LP; compress (aliases snapshot/rebuild) releases the backend and keeps a compressed flat-LP snapshot between solves. Useful for test sweeps / benchmarking the whole suite under one memory mode. An unset or unrecognised value falls back to the per-run option / default. Defined out-of-line in source/planning_options_lp.cpp (keeps <cstdlib> / the env read out of this header).

std::string_view gtopt::PlanningOptionsLP::sddp_lp_debug_passes() const

Comma-separated SDDP passes whose LP-debug dump is active when lp_debug=true. Empty / unset defaults to "forward,aperture" (legacy).

Returns empty string by default.

std::vector<int> gtopt::PlanningOptionsLP::sddp_markov_states() const

Scene → Markov-state assignment for cut_sharing_mode = markov (SddpOptions::markov_states). Empty when unset.

std::vector<double> gtopt::PlanningOptionsLP::sddp_markov_transition() const

Row-major M×M Markov transition matrix for cut_sharing_mode = markov (SddpOptions::markov_transition). Empty when unset.

auto gtopt::PlanningOptionsLP::sddp_max_async_spread() const

Maximum async iteration spread (default: 0 = synchronous).

When > 0 and cut_sharing == none, the SDDP solver takes the async path (solve_async): each scene progresses through its own forward / backward iteration loop as SDDPWorkPool tasks, the pool's SDDPTaskKey priority schedules the slowest-iter scenes first, and the spread between the fastest and slowest scene is bounded by this value.

Default 0 routes to the synchronous coordinator path instead: one driver thread per scene per pass, lockstep across iterations. Benchmarking on the large hydrothermal case (2026-06) found the coordinator/lockstep path faster at every level (warmup −19 %, uninodal −35 %, transport −38 %, bounds identical) because the async path pays an after-convergence overshoot — once a level converges every scene computes and discards a full extra iteration — and funnels all solves through the shared pool's burst-submit dispatch. In the lockstep path scene-level priority is moot (all scenes share an iteration per pass), so nothing is lost by retiring async as the default. Set > 0 only when in-flight task heterogeneity (e.g. heavily unbalanced scene complexity) actually justifies overlapping iterations; 1 is the tightest non-trivial spread.

auto gtopt::PlanningOptionsLP::sddp_max_iterations() const

Gets the maximum SDDP iterations.

Returns Maximum number of forward/backward iterations (default: 100)

auto gtopt::PlanningOptionsLP::sddp_min_iterations() const

Gets the minimum SDDP iterations before convergence.

Returns Minimum iterations before convergence (default: 2)

auto gtopt::PlanningOptionsLP::sddp_multi_cut_threshold() const

Gets the multi_cut threshold.

Returns Forward-pass infeasibility count before auto-switching to multi_cut (default: 10; 0 = never auto-switch)

const auto& gtopt::PlanningOptionsLP::sddp_num_apertures() const noexcept

First-N selector applied to each phase's Phase::apertures list. nullopt = no truncation (use full per-phase list). See SddpOptions::num_apertures for full semantics.

bool gtopt::PlanningOptionsLP::sddp_pool_cpu_factor_is_set() const

Whether the user explicitly set the SDDP pool CPU factor.

When false, SDDPMethod may auto-cap the resolved factor to 1.0 for many-scene runs (the scene×aperture backward tasks already saturate every core, so over-commit only adds scheduler contention). When true, the resolved value is honored verbatim.

bool gtopt::PlanningOptionsLP::sddp_release_after_alpha() const noexcept

Whether aperture clones bypass the backend's native clone() and are built via LinearInterface::clone_from_flat() instead (manual route, no global mutex).

Returns true by default — measured ~2-3× speed-up on the the large hydrothermal case aperture phase by escaping the global s_global_clone_mutex that serialises CPXcloneprob calls across the SDDP work pool. Safe under all LowMemoryMode settings: the call site falls back to the native clone() route automatically when the source has no snapshot (has_snapshot_data() == false), which is the only condition where the manual route cannot run. Set to false to restore the legacy native-clone path. sddp_options.release_after_alpha (default true). Release each low-memory backend right after alpha registration (false: keep it live until the post-initialisation sweep, the previous behaviour).

bool gtopt::PlanningOptionsLP::sddp_release_backends() const noexcept

sddp_options.release_backends (default true). Under low_memory_mode = off, release each solver backend after its solve and rebuild it from an uncompressed flat-LP snapshot on the next visit, warm-starting from the saved basis (false: keep every LP live for the whole run, the previous default). Under compress backends are always released.

auto gtopt::PlanningOptionsLP::sddp_save_aperture_lp() const

Whether to save LP files for infeasible apertures.

Returns false by default (disabled).

auto gtopt::PlanningOptionsLP::sddp_scale_alpha() const

Gets the scale divisor for future cost variable α

Returns α scale divisor (default: 1000, analogous to PLP varphi scale) Returns the user-provided scale_alpha, or 0 for auto-scale (computed at runtime as max state-variable var_scale).

Name gtopt::PlanningOptionsLP::sddp_sentinel_file() const

Gets the sentinel file path for graceful SDDP stop.

Returns Sentinel file path or empty string (no sentinel)

auto gtopt::PlanningOptionsLP::sddp_simulation_mode() const

Simulation mode: no training iterations, forward-only pass.

Returns true if simulation mode is enabled (default: false)

auto gtopt::PlanningOptionsLP::sddp_stationary_gap_ceiling() const

Gets the absolute gap ceiling for the secondary convergence tests.

Returns Ceiling in [0, 1]; 1.0 disables the guard.

auto gtopt::PlanningOptionsLP::sddp_stationary_tol() const

Gets the stationary-gap convergence tolerance.

When positive, enables the secondary convergence criterion: if the relative change in the gap over the last stationary_window iterations falls below this threshold, the solver declares convergence even when the gap exceeds convergence_tol. Default: 0.0 (disabled).

auto gtopt::PlanningOptionsLP::sddp_stationary_window() const

Gets the look-back window for stationary gap detection.

Returns Number of iterations to look back (default: 10)

auto gtopt::PlanningOptionsLP::sddp_terminal_failure_threshold() const

Gets the consecutive-structural-failure threshold for terminal-skip.

Returns Iter count; 0 disables the terminal-skip mechanism.

auto gtopt::PlanningOptionsLP::sddp_update_lp_skip() const

Gets the global update_lp skip count.

Returns Number of SDDP iterations to skip between update_lp dispatches

void gtopt::PlanningOptionsLP::set_output_directory(std::string dir)

Redirect every subsequent output write (write_out, per-cell sim-pass emission) to dir. Used by the cascade method to route an intermediate level's output into its own subdirectory.

const SolverOptions& gtopt::PlanningOptionsLP::solver_options() const noexcept

Gets the global LP solver options sub-object.

Returns Const reference to the SolverOptions from the wrapped PlanningOptions

Returns the SolverOptions sub-object embedded in the planning JSON options block.

StartupTierIntegrality gtopt::PlanningOptionsLP::startup_tier_integrality() const

Default integrality of the startup-tier selectors (model_options.startup_tier_integrality). Unset or unknown → StartupTierIntegrality::continuous.

auto gtopt::PlanningOptionsLP::strict_storage_emin() const

Whether to enforce the per-stage emin floor as a HARD lower bound on the storage sini and last-block efin columns.

When true (default), both columns get lowb = stage_emin — the strictest per-stage volume-constraint enforcement. Set to false for the PLP-style relaxation (lowb = 0) when the LP needs to dip below the floor at iter-0 of an SDDP cascade without becoming infeasible.

auto gtopt::PlanningOptionsLP::theta_max() const

Gets the bound for voltage-angle variables (θ ∈ [−theta_max, +theta_max]).

Priority: model_options.theta_max (explicit) → default_theta_max (2π). PlanningLP::auto_scale_theta computes a topology-aware override (Σ_l tmax_l · x_τ_l) and stores it on model_options.theta_max before LP build, so the 2π fallback only applies under auto_scale=false. Avoids the historical ±2π artifact that secretly capped flows below tmax whenever tmax · x_τ > 2π (e.g., on IEEE 9-bus where 250 MW · 0.0576 = 14.4 rad ≫ 2π).

auto gtopt::PlanningOptionsLP::tiny_reactance_rel_threshold() const

Gets the treatment of nonzero sub-threshold reactances.

Priority: model_options.tiny_reactance_mode (string) → default_tiny_reactance_mode (tie). An unrecognised string falls back to the default.

Relative tie floor (see default_tiny_reactance_rel_threshold).

TransitionIntegrality gtopt::PlanningOptionsLP::transition_integrality() const

Default integrality of the commitment startup / shutdown columns (model_options.transition_integrality). Unset or unknown → TransitionIntegrality::automatic (validation rejects unknown names up front).

bool gtopt::PlanningOptionsLP::use_line_dlr() const noexcept

model_options.use_line_dlr (default true): when false every Line.dlr block is ignored and the static tmax applies.

auto gtopt::PlanningOptionsLP::use_line_losses() const

Gets the line loss modeling flag from model_options.

auto gtopt::PlanningOptionsLP::use_uid_fname() const

Gets the UID filename usage flag, using default if not set.

Returns Whether to use UIDs in filenames

const auto& gtopt::PlanningOptionsLP::variable_scale_map() const noexcept

Gets the variable scale map built from variable_scales entries.

The map provides lookup(class_name, variable, uid) to resolve scale factors with per-element > per-class > default (1.0) priority.

Global scales (scale_theta, scale_alpha) are auto-injected into this map by populate_variable_scales() at construction time. Per-element fields (Battery::energy_scale, Reservoir::energy_scale) still take precedence over map entries.

OutputSelection gtopt::PlanningOptionsLP::write_out() const noexcept

Which output fields OutputContext should emit. Default is OutputFlags::all — primal solutions, row duals, and reduced costs, all unscoped (every element class included). The reduced-cost streams are needed by gtopt_marginal_units to identify the marginal unit at each (bus, scene, stage, block) — without them the attribution must fall back to the static gcost from the planning JSON, which silently fails for piecewise generators and for hydro / battery units whose true MC is a reservoir / battery shadow price. Users who want a leaner output footprint can pass any of:

  • --write-out sol primal only
  • --write-out sol,dual primal + LMPs
  • --write-out sol,dual,rc:Generator primal + duals everywhere, rc only on Generator

Bound to CLI --write-out and JSON write_out.

Variable documentation

static Real gtopt::PlanningOptionsLP::default_battery_annual_standing_loss

Default Battery self-discharge [p.u./year] applied when a Battery leaves annual_standing_loss unset.

0.48 = 4 %/month × 12 in gtopt's linear convention (hourly drain annual_standing_loss / 8760 ≈ 5.48e-5/h; a 730 h month loses exactly 4 % of the stored energy in a single block). Lithium-ion cells self-discharge ≈ 1–3 %/month (Battery University BU-802b; Wikipedia "Self-discharge") plus ≈ 3 %/month drawn by the protection circuit / BMS (BU-802b); 4 %/month is a conservative combined cell + BMS figure. The positive drain also breaks the LP degeneracy that otherwise admits cost-free charge/discharge zig-zag. Override planning-wide with model_options.battery_annual_standing_loss (0 restores the legacy lossless default).

static Real gtopt::PlanningOptionsLP::default_dc_line_reactance_threshold

Default per-unit reactance floor for zero-impedance ties.

Lines whose effective per-unit susceptance term |x_pu| = |X/V²| falls below this value lose their flow term in the Kirchhoff assembler — zero-impedance tie under tiny_reactance_mode = tie (default), DC line (X rewritten to 0 by PlanningLP::validate_line_reactance) under dc — eliminating outlier x_τ coefficients that blow up CPLEX/HiGHS kappa.

1e-6 is conservative: real transmission x_pu ≥ 1e-3 (4 OOM above), real distribution x_pu ≥ 1e-4 (2 OOM above), and real EHV lines in physical units (e.g. 220 kV, X=0.1 Ω → x_pu ≈ 2e-6) are never falsely promoted — a 1e-5 floor WOULD wrongly catch them. V-vs-kV unit-typo lines (x_pu ≈ 1e-7…1e-9) and HVDC/phase-shifters (X = 0) are caught. The effective floor is max(this, tiny_reactance_rel_threshold × median |X/V²|); set both to 0.0 to disable promotion entirely.

static Real gtopt::PlanningOptionsLP::default_dc_line_resistance_threshold

Default per-unit resistance floor for lossless auto-promotion.

Lines whose per-unit loss term |R/V²| falls below this value are rewritten to R = 0 by PlanningLP::validate_line_resistance and skipped by the loss assembler — eliminating the outlier line_loss*_link coefficients (∝ 1/(R/V²)) that very-low-R lines inject as the largest matrix entries and that blow up --no-scale CPLEX/HiGHS kappa.

The loss-link coefficient is driven by R/V² (X is irrelevant), so the dimensionally-correct test is |R/V²|, not |R| or the R·X product (which misses low-R / normal-X lines). The threshold is 1e-7 — one decade BELOW the reactance floor (1e-6), because real lines run lower in R/V² than in X/V² (EHV lines have R ≪ X): a real 220 kV line with R = 0.01 Ω sits at R/V² = 2e-7, so a 1e-6 resistance floor would wrongly strip its losses, whereas 1e-7 spares it while still catching V-vs-kV unit-typo / busbar lines (e.g. R/V² ≈ 5e-8). Set to 0.0 via --set model_options.dc_line_resistance_threshold=0 to disable.

static Real gtopt::PlanningOptionsLP::default_demand_fail_cost

Default penalty for unserved demand [$/MWh] (value of lost load).

Applied when model_options.demand_fail_cost is unset. A per-demand Demand.fcost always overrides it. An explicit demand_fail_cost: 0 keeps its literal meaning (unpenalized, freely sheddable load); a hard, non-sheddable demand is requested per element with Demand.forced.

static KirchhoffMode gtopt::PlanningOptionsLP::default_kirchhoff_mode

Default Kirchhoff Voltage Law formulation.

cycle_basis (loop-flow form, PyPSA-style) is the default because for meshed grids it produces a strictly smaller LP than node_angle (no per-bus theta column, fewer KVL rows: one per fundamental cycle instead of one per line — typically |L| − |B| + #islands rows vs |L|). On CEN-scale cases this is ~40 % smaller per block. Switch to node_angle explicitly when the case needs per-stage topology changes or phase-shift transformers (which require the bus-angle form).

static CompressionCodec gtopt::PlanningOptionsLP::default_output_compression

Default compression codec for Parquet output files.

zstd since 2026-05-19 — empirically the best ratio × decode-speed combo for the dense long-form value column produced by the long-only output writer. On the 2-year case zstd + long + BYTE_STREAM_SPLIT + round8 lands at ~298 MB vs ~1 GB for the legacy snappy + wide combination. All modern parquet readers (Arrow ≥ 1.8, pandas, polars, duckdb, R arrow) read it natively.

Use output_compression: snappy when faster encode-side latency matters more than archival ratio, or output_compression: lz4 when downstream consumers prefer the LZ4 frame format.

History: between 2026-05-18 and 2026-05-19 the default was briefly flipped to lz4, but resolve_parquet_codec was missing the lz4 mapping — every column was silently written UNCOMPRESSED. The codec table was fixed; default flipped from snappy to zstd once long-form + BYTE_STREAM_SPLIT made the ratio win unambiguous.

lp_compression (LP debug files) keeps zstd as its default — those files are large textual dumps where the ratio matters and decode speed does not.

static int gtopt::PlanningOptionsLP::default_output_round_decimals

Solution output is long-only — a 6-column non-zero-only shape (scenario, stage, block, uid, value) with int32_t (Uid) keys and a BYTE_STREAM_SPLIT-encoded value column. Combined with the matching zstd compression default, this produces a 3-7× smaller on-disk footprint on the typical 0.1 %-dense gtopt output (e.g. 1 GB → 298 MB on the 2-year case). The legacy wide (uid:N column-per-element) layout was removed; convert long files to wide externally if ever needed, e.g. df.pivot_table(index=["scenario","stage","block"], columns="uid", values="value", fill_value=0.0). Decimal places to keep on the on-disk value columns.

Default 7 (since 2026-05-19) — triggers the float32 specialization in make_field_arrays_long. Float32 has ~7 significant decimal digits, so rounding the double to 7 decimals first and then casting to float32 produces a lossless (within float32 precision) representation that halves the raw value-column byte budget. Combined with BYTE_STREAM_SPLIT + zstd this lands the 2-year case at ~265 MB (vs 305 MB at double + d=8 + zstd; vs ~1 GB at the legacy wide + snappy default).

Values 1..7 → float32 storage. Value ≥ 8 → double storage with explicit round_to_digits (the "I need more than 7 decimal digits" path). Value ≤ 0 → no rounding, double storage (the "verify all 15+ digits" opt-out).

Bound to JSON output_round_decimals and CLI --output-round-decimals.

static Real gtopt::PlanningOptionsLP::default_scale_objective

Default objective function scaling factor for MONOLITHIC method.

For SDDP / cascade methods, scale_objective() returns 1.0 unconditionally (see accessor doc). This constant is the default for the legacy monolithic LP path only — kept at 1000 so the (large) set of monolithic-MIP unit-test fixtures continue to read obj values in LP-space units as historically.

Why SDDP defaults to 1.0: 2026-05 benchmark on the large hydrothermal case showed scale_objective=1000 is the dominant numerical-conditioning contributor to basis kappa. Measured at iter 15 of a 16-scene, 51-phase, 7,431-cut hot-start:

  • scale_objective=1000 (old default) : kappa = 1.27e+08
  • scale_objective=1 (new SDDP) : kappa = 3.97e+07 (3.2× lower)
  • All layers off (--no-scale) : kappa = 2.01e+07 (6.3× lower)

Solution quality (gap, LB, UB) is bit-identical across all scaling configurations. The 1000× division of obj coefficients was intended to normalise cost magnitudes from $/MWh into LP- friendly range, but together with per-element auto_scale and Ruiz equilibration it widens the matrix dynamic range, hurting basis-condition.

See also: equilibration_method() (ruiz for multi-bus Kirchhoff, row_max otherwise).

static Bool gtopt::PlanningOptionsLP::default_sddp_aperture_cut_resolve

Default for SddpOptions::aperture_cut_resolve: skip the post-cut source re-solve on the aperture path (PLP parity, saves one LP solve per backward step).

static Bool gtopt::PlanningOptionsLP::default_sddp_backward_resolve_target

Re-solve target phase t LP at v̂_{t-1} before extracting cut data. Default true (textbook one-iter-tight SDDP cuts that propagate through all phases in one pass). Set false per case in JSON to fall back to the cheaper forward-cached cut data. See SDDPOptions::backward_resolve_target for the cost trade-off.

static Real gtopt::PlanningOptionsLP::default_sddp_convergence_confidence

Default confidence level for statistical convergence.

0.0 (DISABLED) — the statistical CI test (PLP-style UB - LB <= z·σ) is opt-in. Under heterogeneous-scene scatter (σ ≈ 50 % of mean on Maule-type large cases) z·σ trivially exceeds the absolute gap at 25 % relative, declaring premature convergence. Set to 0.95 to enable the standard 95 % CI test, or 0.50 for a tighter narrow-CI variant.

static Real gtopt::PlanningOptionsLP::default_sddp_convergence_tol

Default relative convergence tolerance.

1 % is the industry-standard SDDP/Benders gap target. Tighter (0.1 % or 0.01 %) is rarely achievable on production hydro/thermal problems and tends to leave the solver running to max_iterations; looser (5 %) is fine for early prototyping.

static Real gtopt::PlanningOptionsLP::default_sddp_cut_coeff_eps

Default cut coefficient epsilon for filtering tiny coefficients.

PLP parity: PLP's FactEPS = 1e-8 (getopts.f:231) is the single tolerance used both as the ray-zero threshold and the dx-filter scale in osi_lp_get_feasible_cut (osicallsc.cpp:723,727). We use the same value as cut_coeff_eps — the tighter 1e-8 lets weakly-coupled links survive the filter (1e-6 would drop them silently on large-trial-value cases). Academic / toy fixtures can raise this via JSON if they need the looser legacy 1e-6.

static ElasticFilterMode gtopt::PlanningOptionsLP::default_sddp_elastic_mode

Default elastic filter mode.

Set to farkas_recursive — the canonical SDDP feasibility cut (Van Slyke & Wets 1969 L-shaped; Füllner & Rebennack 2023 §17 recursive multistage extension). Built from this LP's OWN elastic Phase-1 dual rays (Farkas certificates) — no solver Farkas API — so the cut is a provably valid supporting hyperplane of the feasibility region (removes only infeasible states, never a feasible one), which is the property that guarantees SDDP convergence. On the 2-yr Maule/Laja parity case it is the fastest of the working modes by deterministic ticks (8.44M vs chinneck/iis 12.5M, −32%) at equal solution quality (see test_farkas_recursive_cuts.cpp).

Other modes remain available explicitly: state_repair (alias plp) — PLP AgrElastici single-variable cuts, for bit-faithful PLP replication; chinneck (alias iis) — Chinneck IIS elastic filter, marginally tighter cuts at higher cost. single_cut / multi_cut are the legacy row-dual modes and are NOT recommended (they did not converge on the parity cascade).

static Real gtopt::PlanningOptionsLP::default_sddp_elastic_penalty

Default elastic slack penalty (per physical unit, scaled by var_scale per link inside relax_fixed_state_variable).

Reduced from 1e3 → 1e2: with the Chinneck IIS filter the penalty no longer needs to dominate natural generation costs (~50 $/MWh). Smaller penalties keep the LP matrix well-conditioned and reduce rescale_benders_cut warnings. Override via --set sddp_options.elastic_penalty=<p> or the sddp_options.elastic_penalty JSON field if a particular case needs a stronger forcing term.

static Real gtopt::PlanningOptionsLP::default_sddp_fact_eps

Default PLP FactEPS tolerance for elastic_mode = state_repair (alias plp) and farkas_recursive.

Mirrors PLP's FactEPS compiled default (getopts.f:231 = 1e-8; the CEN production runs override it to 1e-10 via PLP_FACTEPS). Consumed by the PLP-exact feasibility-cut builder (build_plp_feasibility_cuts) and by the recursive builder (build_farkas_recursive_cut).

static Int gtopt::PlanningOptionsLP::default_sddp_fact_max_cycles

Default PLP FactMXC solve-cycle cap for elastic_mode = state_repair (alias plp) and farkas_recursive.

500 matches the CEN production runs' PLP_FACTMXC setting (PLP's compiled default is 5000). Caps solve cycles per (scene, phase) LP within one forward pass; exceeding it declares the scene infeasible for the iteration.

static Bool gtopt::PlanningOptionsLP::default_sddp_forward_fail_stop

Default for the scene-level fail-stop forward pass.

true (the new default) — when an infeasible phase emits an fcut on its predecessor, stop the scene's forward pass for the current iteration. The next iteration restarts from p1 with the freshly accumulated cuts.

false — restore the legacy PLP-style backtracking cascade: decrement phase_idx after installing the fcut and re-solve p-1 in the same forward pass, recursing back through phases until a feasible point is reached or forward_max_attempts is exhausted.

static Bool gtopt::PlanningOptionsLP::default_sddp_forward_infeas_rollback

Per-scene rollback default — see SDDPOptions::forward_infeas_rollback in sddp_types.hpp for full semantics. Flipped to true 2026-04-30 (plan step 6) after one full the large hydrothermal case run confirmed the feature does not regress legacy paths: every pre-existing test that doesn't produce a real scene_feasible[s] == 0 outcome stays a no-op under the rollback hook + stall guard, and the stall guard's "no recovery path" abort only fires when ALL previously-failed scenes saw zero new cuts since their last failure (a strict improvement over the legacy "spin until max_iterations" loop). Callers that want the legacy behaviour can still opt out by setting sddp.forward_infeas_rollback: false in JSON.

static Int gtopt::PlanningOptionsLP::default_sddp_min_iterations

Default minimum iterations before declaring convergence.

1 iteration is the minimum that still lets the convergence check fire on the first solved iter. Pure SDDP runs that want the 3-iter bootstrap guard (against declaring convergence on iter 0's placeholder LB or iter 1's barely-moved LB) can set min_iterations higher explicitly; cascade level 0 still does so via plp2gtopt since the 1-aperture face-value bound there is genuinely noisy. L1+ inherit a converged envelope and may legitimately exit on their first qualifying iter — leaving the default at 3 forced uninodal to grind two redundant iters past the first time |gap| dropped inside the ceiling (observed on the large hydrothermal case, 2026-05-14).

static int gtopt::PlanningOptionsLP::default_sddp_multi_cut_threshold

Default multi_cut threshold (auto-switch after this many cumulative forward-pass infeasibilities at a phase).

Counter is persistent across iterations (no reset on successful solves), so the threshold counts total fcut events at a (scene, phase), not consecutive ones. Reduced Default: 100. Under ElasticFilterMode::chinneck (the gtopt default), the IIS-filtered fcut alone is usually enough to cut off the bad trial over subsequent iterations. build_multi_cuts can install source_col {<=,>=} dep_val_phys bound cuts whose RHS (dep_val_phys from the Chinneck Phase-1 LP) may exceed the source phase's physically reachable set, making the master LP infeasible (observed on the large hydrothermal case: reservoir mcut required end-of-phase energy ≥ 330.33 with a physical cap of ~207.78 + limited inflow). Raising the threshold defers the risky bound cuts until many infeasibility events have accumulated at the same (scene, phase), signalling that the fcut alone is not sufficient.

static Real gtopt::PlanningOptionsLP::default_sddp_stationary_gap_ceiling

Default absolute gap ceiling for the secondary convergence tests (stationary + statistical CI).

Refuse a stationary (ΔUB or statistical + stationary) stop while the signed relative gap is at or above 2 %; the run keeps iterating to max_iterations. Negative gaps (cut overshoot) pass.

Defends against heterogeneous-scene σ explosion (large-case trace_28: gap = 25 % declared converged at iter 2 because σ ≈ 77 M dominated the 38 M absolute gap) and frozen-LB pathologies (LB stuck at 0, gap = 1 flat → gap_change = 0). Set to 1.0 to disable the ceiling (legacy behaviour).

static Real gtopt::PlanningOptionsLP::default_sddp_stationary_tol

Default stationary-gap tolerance.

"Gap stopped moving" threshold — gap_change < tol means the gap is stationary. Tighter than convergence_tol (0.5 % vs 1 %) so the safety net only fires when the gap has clearly stalled, not while it is still trending.

static TinyReactanceMode gtopt::PlanningOptionsLP::default_tiny_reactance_mode

Default treatment of nonzero sub-threshold reactances.

tie: a line with X = 0 or |X/V²| < dc_line_reactance_threshold is a zero-impedance tie (KVL row without the flow term), the physical limit of a near-zero-impedance AC branch. The legacy dc treatment let the LP use such lines as free phase shifters.

static Real gtopt::PlanningOptionsLP::default_tiny_reactance_rel_threshold

Default relative tie floor (tiny_reactance_rel_threshold).

A line with |X/V²| < 0.01 · median(|X/V²|) is a zero-impedance tie. Tying such a line changes the flow split of any parallel path of median impedance by at most ~1 %, while its KVL flow coefficient would sit two or more decades below the rest of the network. CEN PCP 2026-11-09: median 2.3e-4 → floor 2.3e-6, ties the 42 PLEXOS X = 1e-4 p.u. generator-connection placeholders (x = 1e-6, exactly the absolute floor) that the absolute 1e-6 floor misses (44 ties instead of 1); x_τ spread 1.6e4 → 3.3e3.