gtopt::Phase struct

Groups consecutive planning stages into a higher-level period.

When only one phase is needed (the common case) it is created automatically with default values that cover all stages.

Public static variables

static std::string_view class_name
Class name constant used for serialisation/deserialisation.

Public functions

auto is_active() const -> auto noexcept
auto is_continuous() const -> auto noexcept

Public variables

OptBool active
Activation status (default: active).
OptName aperture_system_file
Array<Uid> apertures
OptBool continuous
Size count_stage
Number of stages in this phase [dimensionless].
Size first_stage
0-based index of the first stage in this phase [dimensionless]
OptName name
Optional human-readable label.
Uid uid
Unique identifier for the phase.

Variable documentation

OptName gtopt::Phase::aperture_system_file

Optional per-phase override of the SDDP backward-pass aperture system: a path to a Planning JSON whose .system (and its .options.model_options) replaces the regular forward system when solving this phase's apertures in the backward pass. Highest priority in the resolution chain (Phase → CascadeLevel → sddp_options → regular system). The parent simulation is reused unchanged and the reduced system must keep the same reservoir/storage/α inter-phase state elements (matched by uid). When unset, the global resolution applies.

Array<Uid> gtopt::Phase::apertures

Optional aperture UIDs to use in this phase's SDDP backward pass. When empty, all apertures from the global aperture_array are used (iterated in aperture_array order). When non-empty, only the listed aperture UIDs participate in the backward-pass cut computation for this phase. The list is emitted by plp2gtopt sorted wettest → driest so that SddpOptions::num_apertures = N picks the N wettest per phase via truncate_apertures (see sddp_aperture_pass.cpp).

OptBool gtopt::Phase::continuous

When true, all integer/binary variables in this phase become continuous (LP relaxation). Can be set per-phase in JSON or globally via model_options.continuous_phases.

Size gtopt::Phase::count_stage

Number of stages in this phase [dimensionless].