gtopt::Simulation struct

Complete time-structure of a planning simulation.

A Simulation bundles all temporal elements. When a field is absent from the input JSON, gtopt uses a default single scenario, single stage/block configuration so that simple single-snapshot cases require minimal input.

Multiple JSON files can be merged with Planning::merge(), allowing the time structure to be split across files (e.g. blocks in one file, stages in another).

Public functions

auto merge(Simulation&& sim) -> constexpr void

Public variables

OptReal annual_discount_rate
Annual discount rate for present-value cost calculations.
Array<Aperture> aperture_array
Array<Block> block_array
Ordered list of time blocks.
OptName boundary_cuts_file
CSV file with boundary (future-cost) cuts for the last phase.
std::optional<BoundaryCutsValuation> boundary_cuts_valuation
Valuation basis for boundary cut coefficients and RHS.
Array<Iteration> iteration_array
OptReal kappa_threshold
Condition-number threshold above which kappa warnings fire.
std::optional<KappaWarningMode> kappa_warning
What to do when an LP solve produces a high condition number.
Array<Phase> phase_array
List of planning phases.
std::optional<ProbabilityRescaleMode> probability_rescale
When to rescale scenario/scene probabilities to sum 1.0.
Array<Scenario> scenario_array
List of stochastic scenarios.
Array<Scene> scene_array
List of scene combinations.
Array<Stage> stage_array
Ordered list of planning stages.

Variable documentation

OptReal gtopt::Simulation::annual_discount_rate

Annual discount rate for present-value cost calculations.

Applied per-stage as exp(-ln(1+r) × t / 8766) where t is the cumulative hours from the start of the horizon. Combined with each stage's discount_factor to form the effective discount factor. Default: 0.0 (no annual discounting).

Array<Aperture> gtopt::Simulation::aperture_array

Aperture definitions for SDDP backward pass (optional)

OptName gtopt::Simulation::boundary_cuts_file

CSV file with boundary (future-cost) cuts for the last phase.

External optimality cuts that approximate the expected future cost beyond the planning horizon. Used by both SDDP and monolithic solvers. If empty, no boundary cuts are loaded.

std::optional<BoundaryCutsValuation> gtopt::Simulation::boundary_cuts_valuation

Valuation basis for boundary cut coefficients and RHS.

  • end_of_horizon (default): no discounting applied.
  • present_value: apply the last-stage effective discount factor.

Array<Iteration> gtopt::Simulation::iteration_array

Per-iteration solver control (optional, keyed by index)

OptReal gtopt::Simulation::kappa_threshold

Condition-number threshold above which kappa warnings fire.

Default: 1e9. Only used when kappa_warning is not none.

std::optional<KappaWarningMode> gtopt::Simulation::kappa_warning

What to do when an LP solve produces a high condition number.

  • none: no checking.
  • warn: log a warning (default).
  • save_lp: warn and save the LP file.

std::optional<ProbabilityRescaleMode> gtopt::Simulation::probability_rescale

When to rescale scenario/scene probabilities to sum 1.0.

  • none: warn only, no rescaling.
  • build: rescale at build/validation time.
  • runtime: rescale at build time and at runtime (default).