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 scene_index = SceneIndex {unknown_index}) explicit
SceneLP(Scene scene, std::span<const Scenario> scenarios, SceneIndex scene_index = SceneIndex {unknown_index}) explicit
Construct a SceneLP from a Scene and a collection of Scenario elements.

Public functions

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

Function documentation

gtopt::SceneLP::SceneLP(Scene scene, std::span<const Scenario> scenarios, SceneIndex scene_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
scene_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.

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

Returns Index of this scene in parent container

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

Check if the scene is active.

Returns true if the scene is active, false otherwise

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

const PositionVector<SceneScenarioIndex, ScenarioLP>& gtopt::SceneLP::scenarios() const

Get all scenario elements associated with this scene.

Returns Span of ScenarioLP elements

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

Get the unique identifier of the scene.

Returns The scene's unique identifier