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

void merge(Simulation&& sim)

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 block_hour_map
Path to a parquet/csv file mapping blocks to calendar hours.
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::block_hour_map

Path to a parquet/csv file mapping blocks to calendar hours.

Metadata reference produced by plp2gtopt (from indhor.csv) and consumed by downstream post-processing tools (e.g. ts2gtopt's build_hour_block_map) to reconstruct hourly series from block-granularity solver output. Not used by the LP solver itself.

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. DEPRECATED alias of FutureCost::cuts_file (any method); folded into the FutureCost element by resolve_future_cost_aliases and then cleared.

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. DEPRECATED alias of FutureCost::valuation (any method); folded into the FutureCost element by resolve_future_cost_aliases and then cleared.

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).