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

Represents a directed edge in the railway network graph. More...

#include <RailwayNetwork.hpp>

Public Member Functions

 Edge (size_t const source, size_t const target, double const length, double const maxSpeed, bool const breakable=BREAKABLE_DEFAULT, double const minBlockLength=MIN_BLOCK_LENGTH_DEFAULT, double const minStopBlockLength=MIN_STOP_BLOCK_LENGTH_DEFAULT)
 Constructs an Edge with explicit attribute values.
 Edge (size_t const source, size_t const target, double const length, double const maxSpeed, std::optional< bool > const &breakable, std::optional< double > const &min_block_length, std::optional< double > const &min_stop_block_length)
 Constructs an Edge with optional attribute values falling back to their defaults when not provided.
bool operator== (const Edge &other) const
 Compares two edges for equality.

Public Attributes

size_t source
size_t target
double length
double max_speed
bool breakable {BREAKABLE_DEFAULT}
double min_block_length {MIN_BLOCK_LENGTH_DEFAULT}
double min_stop_block_length {MIN_STOP_BLOCK_LENGTH_DEFAULT}

Static Public Attributes

static constexpr bool BREAKABLE_DEFAULT = true
static constexpr double MIN_BLOCK_LENGTH_DEFAULT = 1.0
static constexpr double MIN_STOP_BLOCK_LENGTH_DEFAULT = 100.0

Detailed Description

Represents a directed edge in the railway network graph.

An edge models a physical track segment between two vertices. The breakable flag controls whether a Virtual Sub-Section (VSS) border may be placed anywhere on the segment.

Constructor & Destructor Documentation

◆ Edge() [1/2]

cda_rail::Edge::Edge ( size_t const source,
size_t const target,
double const length,
double const maxSpeed,
bool const breakable = BREAKABLE_DEFAULT,
double const minBlockLength = MIN_BLOCK_LENGTH_DEFAULT,
double const minStopBlockLength = MIN_STOP_BLOCK_LENGTH_DEFAULT )
inline

Constructs an Edge with explicit attribute values.

Parameters
sourceIndex of the source vertex.
targetIndex of the target vertex.
lengthLength of the edge in metres.
maxSpeedMaximum permitted speed on this edge in m/s.
breakabletrue if a VSS border may be placed on this edge; defaults to BREAKABLE_DEFAULT (true).
minBlockLengthMinimum block length in metres; defaults to MIN_BLOCK_LENGTH_DEFAULT (1.0 m).
minStopBlockLengthMinimum block length inside a station stop zone in metres; defaults to MIN_STOP_BLOCK_LENGTH_DEFAULT (100.0 m).

◆ Edge() [2/2]

cda_rail::Edge::Edge ( size_t const source,
size_t const target,
double const length,
double const maxSpeed,
std::optional< bool > const & breakable,
std::optional< double > const & min_block_length,
std::optional< double > const & min_stop_block_length )
inline

Constructs an Edge with optional attribute values falling back to their defaults when not provided.

Parameters
sourceIndex of the source vertex.
targetIndex of the target vertex.
lengthLength of the edge in metres.
maxSpeedMaximum permitted speed in m/s.
breakableOptional breakable flag; std::nullopt uses BREAKABLE_DEFAULT.
min_block_lengthOptional minimum block length; std::nullopt uses MIN_BLOCK_LENGTH_DEFAULT.
min_stop_block_lengthOptional minimum stop-block length; std::nullopt uses MIN_STOP_BLOCK_LENGTH_DEFAULT.

Member Function Documentation

◆ operator==()

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

Compares two edges for equality.

Parameters
otherEdge to compare against.
Returns
true if all edge attributes match; otherwise false.

Member Data Documentation

◆ breakable

bool cda_rail::Edge::breakable {BREAKABLE_DEFAULT}

◆ BREAKABLE_DEFAULT

bool cda_rail::Edge::BREAKABLE_DEFAULT = true
staticconstexpr

◆ length

double cda_rail::Edge::length

◆ max_speed

double cda_rail::Edge::max_speed

◆ min_block_length

double cda_rail::Edge::min_block_length {MIN_BLOCK_LENGTH_DEFAULT}

◆ MIN_BLOCK_LENGTH_DEFAULT

double cda_rail::Edge::MIN_BLOCK_LENGTH_DEFAULT = 1.0
staticconstexpr

◆ min_stop_block_length

double cda_rail::Edge::min_stop_block_length {MIN_STOP_BLOCK_LENGTH_DEFAULT}

◆ MIN_STOP_BLOCK_LENGTH_DEFAULT

double cda_rail::Edge::MIN_STOP_BLOCK_LENGTH_DEFAULT = 100.0
staticconstexpr

◆ source

size_t cda_rail::Edge::source

◆ target

size_t cda_rail::Edge::target

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