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

Represents a station as a named set of network tracks (edge indices). More...

#include <Station.hpp>

Public Member Functions

std::vector< std::pair< size_t, std::vector< cda_rail::index_vector > > > get_stop_tracks (double tr_len, Network const &network, cda_rail::index_set const &edges_to_consider={}) const
 Computes station tracks that can host a stop for a given train length.
bool is_fully_in_station (cda_rail::index_set const &edges) const
 Checks whether all provided edges belong to this station.
bool operator== (const Station &other) const
 Compares two stations for equality.

Public Attributes

std::string name {}
 Station identifier.
cda_rail::index_set tracks {}
 Set of track indices (network edges) that belong to this station.

Detailed Description

Represents a station as a named set of network tracks (edge indices).

A station is identified by its name and contains all tracks on which trains are considered to be within that station.

Member Function Documentation

◆ get_stop_tracks()

std::vector< std::pair< size_t, std::vector< cda_rail::index_vector > > > cda_rail::Station::get_stop_tracks ( double tr_len,
cda_rail::Network const & network,
cda_rail::index_set const & edges_to_consider = {} ) const
nodiscard

Computes station tracks that can host a stop for a given train length.

For each eligible stop edge, the method returns all valid in-station paths ending in that edge whose total length can accommodate tr_len.

Parameters
tr_lenTrain length.
networkNetwork containing the station edges.
edges_to_considerOptional candidate edges. If empty, all station edges are considered.
Returns
Vector of pairs (stop_edge, stop_paths), where stop_paths contains all valid paths ending in stop_edge.

◆ is_fully_in_station()

bool cda_rail::Station::is_fully_in_station ( cda_rail::index_set const & edges) const
nodiscard

Checks whether all provided edges belong to this station.

Parameters
edgesEdges to validate.
Returns
true if every edge in edges is part of tracks; otherwise false.

◆ operator==()

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

Compares two stations for equality.

Returns
bool true if the stations have the same name and tracks, false otherwise.

Member Data Documentation

◆ name

std::string cda_rail::Station::name {}

Station identifier.

◆ tracks

cda_rail::index_set cda_rail::Station::tracks {}

Set of track indices (network edges) that belong to this station.


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