gtopt::line_direction namespace

Classes

struct BusInjection
Injection-sign class flags of one bus (OR of its elements).
struct Edge
One circuit of the transport graph.
struct ElementRefs
struct LineClass
Per-circuit classification.
struct LineDecision
Decision applied to one line in the LP (stored in SystemContext).
struct Summary
Aggregate counts for logging / tests.

Enums

enum class SideClass: std::uint8_t { empty = 0, load = 1, gen = 2, mixed = 3 }
Class of one side of a radial corridor.
enum class Verdict: std::uint8_t { both = 0, ab = 1, ba = 2, dead_end = 3 }
Structural verdict of one circuit.

Functions

auto classify(std::span<const BusInjection> buses, std::span<const Edge> edges) -> std::vector<LineClass>
void collect_element_refs(std::string_view expression, std::string_view element_type, ElementRefs& refs)
auto find_radial(std::size_t n_buses, std::span<const Edge> edges) -> std::vector<bool>
auto side_class(const BusInjection& f) -> SideClass noexcept
Class of a side from its aggregated injection flags.
auto side_verdict(SideClass a, SideClass b) -> Verdict noexcept
Verdict of a radial circuit from the classes of its two sides.
auto summarize(std::span<const LineClass> classes) -> Summary noexcept
Count radial / one-way / dead-end / mixed circuits.
auto verdict_name(Verdict v) -> std::string_view noexcept

Enum documentation

enum class gtopt::line_direction::SideClass: std::uint8_t

Class of one side of a radial corridor.

enum class gtopt::line_direction::Verdict: std::uint8_t

Structural verdict of one circuit.

Enumerators
both

not certified (meshed, or a mixed radial side)

ab

certified one-way bus_a → bus_b

ba

certified one-way bus_b → bus_a

dead_end

certified zero flow (removable)

Function documentation

std::vector<LineClass> gtopt::line_direction::classify(std::span<const BusInjection> buses, std::span<const Edge> edges)

Full classification of every circuit (see the file comment). buses.size() is the bus count; edges reference indices into it.

void gtopt::line_direction::collect_element_refs(std::string_view expression, std::string_view element_type, ElementRefs& refs)

std::vector<bool> gtopt::line_direction::find_radial(std::size_t n_buses, std::span<const Edge> edges)

Mark each circuit that belongs to a radial (bridge) corridor. Parallel circuits between the same bus pair are collapsed first, so a 2-circuit corridor that is a cut is radial (both circuits marked). Self-loops are never radial. O(V + E), iterative (no recursion).

SideClass gtopt::line_direction::side_class(const BusInjection& f) noexcept

Class of a side from its aggregated injection flags.

Verdict gtopt::line_direction::side_verdict(SideClass a, SideClass b) noexcept

Verdict of a radial circuit from the classes of its two sides.

Summary gtopt::line_direction::summarize(std::span<const LineClass> classes) noexcept

Count radial / one-way / dead-end / mixed circuits.

std::string_view gtopt::line_direction::verdict_name(Verdict v) noexcept