gtopt::SimulationLP class

Linear programming representation of a power system simulation.

Encapsulates the LP transformation of a power system simulation model, providing access to all components in their LP form. Maintains references to the original simulation and options objects.

Public types

using global_variable_map_t = StrongIndexVector<SceneIndex, StrongIndexVector<PhaseIndex, state_variable_map_t>>
using lp_key_t = StateVariable::LPKey
using state_variable_key_t = StateVariable::Key
using state_variable_map_t = flat_map<state_variable_key_t, StateVariable>

Constructors, destructors, conversion operators

SimulationLP(const Simulation& simulation, const PlanningOptionsLP& options) explicit
Constructs a SimulationLP from a Simulation.
SimulationLP(const SimulationLP&) defaulted
SimulationLP(SimulationLP&&) defaulted noexcept
~SimulationLP() defaulted noexcept

Public functions

auto add_state_variable(Key&& key, ColIndex col) -> const StateVariable & -> constexpr auto
auto apertures() const -> constexpr const auto& noexcept
Gets the aperture definitions from the underlying Simulation.
auto blocks() const -> constexpr const auto& noexcept
auto operator=(const SimulationLP&) -> SimulationLP& defaulted noexcept
auto operator=(SimulationLP&&) -> SimulationLP& defaulted noexcept
auto options() const -> constexpr const PlanningOptionsLP& noexcept
Gets the LP solver options.
auto phases() const -> constexpr const auto& noexcept
Gets all phase LP representations.
auto prev_stage(const StageLP& stage) const noexcept -> std::pair< const StageLP *, const PhaseLP * > -> constexpr auto
auto previous_stage(const StageLP& stage) -> constexpr auto
auto scenarios() const -> constexpr const auto& noexcept
Gets all scenario LP representations.
auto scenes() const -> constexpr const auto& noexcept
Gets all scene LP representations.
template<typename Self Self>
auto simulation(this Self& self) -> constexpr auto&& noexcept
Gets the underlying simulation model.
auto stages() const -> constexpr const auto& noexcept
auto state_variable(this Self&& self, Key&& key) -> constexpr auto noexcept
Retrieves a state variable by its key.
auto state_variables() -> constexpr const auto& noexcept
template<typename Self Self>
auto state_variables(this Self&& self, SceneIndex scene_index, PhaseIndex phase_index) -> constexpr auto&& noexcept

Function documentation

gtopt::SimulationLP::SimulationLP(const Simulation& simulation, const PlanningOptionsLP& options) explicit

Constructs a SimulationLP from a Simulation.

Parameters
simulation Reference to the base simulation model
options Reference to LP solver options
Exceptions
std::runtime_error If component validation fails
std::bad_alloc If memory allocation fails

constexpr const auto& gtopt::SimulationLP::apertures() const noexcept

Gets the aperture definitions from the underlying Simulation.

Returns Const reference to the aperture_array

constexpr const PlanningOptionsLP& gtopt::SimulationLP::options() const noexcept

Gets the LP solver options.

Returns Const reference to the options object

constexpr const auto& gtopt::SimulationLP::phases() const noexcept

Gets all phase LP representations.

Returns Const reference to vector of PhaseLP objects

constexpr const auto& gtopt::SimulationLP::scenarios() const noexcept

Gets all scenario LP representations.

Returns Const reference to vector of ScenarioLP objects

constexpr const auto& gtopt::SimulationLP::scenes() const noexcept

Gets all scene LP representations.

Returns Const reference to vector of SceneLP objects

template<typename Self Self>
constexpr auto&& gtopt::SimulationLP::simulation(this Self& self) noexcept

Gets the underlying simulation model.

Returns Reference to the simulation object

template<typename Self Self, typename Key = state_variable_key_t>
constexpr auto gtopt::SimulationLP::state_variable(this Self&& self, Key&& key) noexcept

Retrieves a state variable by its key.

Parameters
self The object instance (deduced via explicit object parameter)
key The key to search for
Returns Optional reference to the state variable if found (const or non-const)