gtopt::SceneLP class

Represents a logical scene with linear programming scenario elements.

This class combines a Scene with its associated ScenarioLP elements, providing a unified interface for scene management in linear programming contexts.

Constructors, destructors, conversion operators

SceneLP() defaulted
SceneLP(Scene scene, const Simulation& simulation, SceneIndex index = SceneIndex {unknown_index}) explicit
SceneLP(Scene scene, std::span<const Scenario> scenarios, SceneIndex index = SceneIndex {unknown_index}) explicit
Construct a SceneLP from a Scene and a collection of Scenario elements.

Public functions

auto count_scenario() const -> constexpr auto noexcept
auto first_scenario() const -> constexpr auto noexcept
auto index() const -> constexpr auto noexcept
auto is_active() const -> constexpr auto noexcept
Check if the scene is active.
auto probability_factor() const -> constexpr auto noexcept
auto scenarios() const -> const std::vector< ScenarioLP > & -> constexpr auto
Get all scenario elements associated with this scene.
auto uid() const -> constexpr auto noexcept
Get the unique identifier of the scene.

Function documentation

gtopt::SceneLP::SceneLP(Scene scene, std::span<const Scenario> scenarios, SceneIndex index = SceneIndex {unknown_index}) explicit

Construct a SceneLP from a Scene and a collection of Scenario elements.

Parameters
scene The Scene object
scenarios Collection of Scenario elements
index Index of this scene in the parent container

Initializes the SceneLP with the given Scene and extracts the relevant ScenarioLP elements based on the Scene's first_scenario and count_scenario.

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

Returns Index of this scene in parent container

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

Check if the scene is active.

Returns true if the scene is active, false otherwise

constexpr auto gtopt::SceneLP::probability_factor() const noexcept

Returns Accumulated probability factor across all scenarios in this scene. Each scenario contributes its own probability_factor (default 1.0).

constexpr auto gtopt::SceneLP::scenarios() const -> const std::vector< ScenarioLP > &

Get all scenario elements associated with this scene.

Returns Span of ScenarioLP elements

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

Get the unique identifier of the scene.

Returns The scene's unique identifier