PlantLP class
#include <gtopt/plant_lp.hpp>
Base classes
-
template<typename ObjectType>class ObjectLP<Plant>
- Wrapper class that adds LP capabilities to objects.
Public types
- using Element = Plant
- using object_type = Plant
- Type of the wrapped object.
Public static variables
- static std::string_view CapacityName
- static std::string_view CommitName
- static std::string_view UniqName
Public static functions
- static auto add_to_output(OutputContext& out) -> bool
Constructors, destructors, conversion operators
- PlantLP(const Plant& plant, const InputContext& ic) explicit
Public functions
- auto add_to_lp(const SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp) -> bool
- auto capacity_rows() const -> const auto& noexcept
- auto class_name(this const Self& self) -> auto noexcept
- auto commit_rows() const -> const auto& noexcept
- auto id() const -> auto noexcept
- auto is_active(const StageLP& stage) const -> bool
- Checks if object is active in given stage.
- auto object() & -> Plant& noexcept
- Gets the wrapped object.
- auto plant(this auto&& self) -> auto&& noexcept
- auto set_id(Uid uid, Name name) -> auto& noexcept
- Sets the object's identifier.
- auto short_name(this const Self& self) -> auto noexcept
- auto sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) -> auto noexcept
- Generates a state variable key for the object.
- auto sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) -> auto noexcept
- auto uid() const -> auto noexcept
- auto uniq_rows() const -> const auto& noexcept
Typedef documentation
using gtopt:: PlantLP:: Element = Plant
#include <gtopt/object_lp.hpp>
Alias for the wrapped data-struct type. Lets generic code reach the canonical LPClassName constant via T::Element::class_name where T is any LP wrapper inheriting from ObjectLP. Single source of truth for the class-name constant lives on the data struct (Bus::class_name, Reservoir::class_name, …); the LP wrappers no longer carry a duplicate ClassName member.
using gtopt:: PlantLP:: object_type = Plant
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
const auto& gtopt:: PlantLP:: capacity_rows() const noexcept
Per-(scenario, stage) per-block Σ-capacity rows (plant_cap_<name>). Empty when pmax is unset.
auto gtopt:: PlantLP:: class_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
const auto& gtopt:: PlantLP:: commit_rows() const noexcept
Per-(scenario, stage) Σ-commit rows (plant_commit_<name>). Empty when n_units is unset.
auto gtopt:: PlantLP:: id() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
bool gtopt:: PlantLP:: is_active(const StageLP& stage) const
#include <gtopt/object_lp.hpp>
Checks if object is active in given stage.
| Parameters | |
|---|---|
| stage | The stage to check |
| Returns | true if active in stage, false otherwise |
Plant& gtopt:: PlantLP:: object() & noexcept
#include <gtopt/object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
auto& gtopt:: PlantLP:: set_id(Uid uid,
Name name) noexcept
#include <gtopt/object_lp.hpp>
Sets the object's identifier.
| Parameters | |
|---|---|
| uid | Unique identifier |
| name | Human-readable name |
| Returns | Reference to self for chaining |
auto gtopt:: PlantLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
auto gtopt:: PlantLP:: sv_key(this const Self& self,
const ScenarioLP& scenario,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
Generates a state variable key for the object.
| Parameters | |
|---|---|
| self | Reference to the object |
| scenario | Scenario context |
| stage | Stage context |
| col_name | The column name for the state variable |
| Returns | StateVariable::Key |
auto gtopt:: PlantLP:: sv_key(this const Self& self,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
auto gtopt:: PlantLP:: uid() const noexcept
#include <gtopt/object_lp.hpp>
| Returns | The object's unique identifier |
|---|
const auto& gtopt:: PlantLP:: uniq_rows() const noexcept
Per-(scenario, stage) Σ-status ≤ 1 rows (plant_uniq_<name>). Empty when uniq_mutex is false.