gtopt::StageLP class

A class representing a stage in a linear programming planning problem.

Encapsulates a collection of blocks with time duration, discounting, and indexing

Public static functions

static auto calculate_discount_factor(double annual_rate, double timeinit) -> constexpr auto noexcept

Constructors, destructors, conversion operators

StageLP() defaulted
StageLP(Stage stage, std::span<const Block> blocks = {}, double annual_discount_rate = 0.0, StageIndex stage_index = StageIndex {unknown_index}, PhaseIndex phase_index = PhaseIndex {unknown_index}) explicit
Constructs a StageLP from a Stage and a collection of blocks.

Public functions

auto annual_discount_rate() const -> constexpr auto noexcept
auto blocks() const -> constexpr const auto& noexcept
auto discount_factor() const -> constexpr auto noexcept
auto duration() const -> constexpr auto noexcept
auto index() const -> constexpr auto noexcept
auto is_active() const -> constexpr auto noexcept
auto month() const -> constexpr auto noexcept
auto phase_index() const -> constexpr auto noexcept
auto stage() const -> constexpr const auto& noexcept
auto timeinit() const -> constexpr auto noexcept
auto total_duration() const -> constexpr auto noexcept
auto uid() const -> constexpr auto noexcept

Function documentation

static constexpr auto gtopt::StageLP::calculate_discount_factor(double annual_rate, double timeinit) noexcept

Returns Combined discount factor (annual and stage-specific)

gtopt::StageLP::StageLP(Stage stage, std::span<const Block> blocks = {}, double annual_discount_rate = 0.0, StageIndex stage_index = StageIndex {unknown_index}, PhaseIndex phase_index = PhaseIndex {unknown_index}) explicit

Constructs a StageLP from a Stage and a collection of blocks.

Parameters
stage The stage definition
blocks Collection of blocks
annual_discount_rate Annual discount rate for time value calculations
stage_index Index of this stage in the parent container
phase_index Index of the parent phase

constexpr const auto& gtopt::StageLP::blocks() const noexcept

Returns Span of blocks in this stage

constexpr auto gtopt::StageLP::duration() const noexcept

Returns Total duration of the stage in hours

constexpr auto gtopt::StageLP::index() const noexcept

Returns Index of this stage in the parent container

constexpr auto gtopt::StageLP::is_active() const noexcept

Returns Whether this stage is active in the planning

constexpr auto gtopt::StageLP::month() const noexcept

Returns Calendar month for this stage (if set)

constexpr auto gtopt::StageLP::uid() const noexcept

Returns Unique identifier for this stage