MTCT
Design Automation and Optimization for ETCS Railway Networks
Loading...
Searching...
No Matches
cda_rail::Vertex Struct Reference

Represents a vertex (node) in the railway network graph. More...

#include <RailwayNetwork.hpp>

Public Member Functions

 Vertex (std::string_view const name, VertexType const type, double const headway=HEADWAY_DEFAULT)
 Constructs a Vertex with an explicit headway value.
 Vertex (std::string_view const name, VertexType const type, std::optional< double > const &headway)
 Constructs a Vertex with an optional headway value.
bool operator== (Vertex const &other) const
 Compares two vertices for equality.

Public Attributes

std::string name
VertexType type
double headway {HEADWAY_DEFAULT}

Static Public Attributes

static constexpr double HEADWAY_DEFAULT {0.0}

Detailed Description

Represents a vertex (node) in the railway network graph.

A vertex models a physical point on the rail topology, such as a signal, a track-detection boundary, or a plain interior node. The type field determines how the vertex is treated by algorithms.

Constructor & Destructor Documentation

◆ Vertex() [1/2]

cda_rail::Vertex::Vertex ( std::string_view const name,
VertexType const type,
double const headway = HEADWAY_DEFAULT )
inline

Constructs a Vertex with an explicit headway value.

Parameters
nameHuman-readable identifier for the vertex.
typeTopological/signal type (NoBorder, VSS, TTD, NoBorderVSS).
headwayAdditional minimum headway (in seconds) imposed at this vertex; defaults to HEADWAY_DEFAULT (0.0).

◆ Vertex() [2/2]

cda_rail::Vertex::Vertex ( std::string_view const name,
VertexType const type,
std::optional< double > const & headway )
inline

Constructs a Vertex with an optional headway value.

Parameters
nameHuman-readable identifier for the vertex.
typeTopological/signal type.
headwayOptional headway in seconds; std::nullopt falls back to HEADWAY_DEFAULT.

Member Function Documentation

◆ operator==()

bool cda_rail::Vertex::operator== ( Vertex const & other) const
inline

Compares two vertices for equality.

Parameters
otherVertex to compare against.
Returns
true if name, type, and headway all match; otherwise false.

Member Data Documentation

◆ headway

double cda_rail::Vertex::headway {HEADWAY_DEFAULT}

◆ HEADWAY_DEFAULT

double cda_rail::Vertex::HEADWAY_DEFAULT {0.0}
staticconstexpr

◆ name

std::string cda_rail::Vertex::name

◆ type

VertexType cda_rail::Vertex::type

The documentation for this struct was generated from the following file: