|
MTCT
Design Automation and Optimization for ETCS Railway Networks
|
Ordered list of network edges that a train follows. More...
#include <Route.hpp>
Classes | |
| struct | EdgePosition |
| Start and end position of one edge within the route. More... | |
Public Member Functions | |
| size_t | size () const |
| Gets the number of edges in the route. | |
| double | length (const Network &network) const |
| Returns the total route length. | |
| bool | empty () const |
| Checks whether the route is empty. | |
| const cda_rail::index_vector & | get_edges () const |
| Provides the edges forming the route in travel order. | |
| EdgePosition | edge_pos_on_route (Network::EdgeInput const &edge, const Network &network) const |
| Returns where a specific edge lies on this route. | |
| EdgePosition | edge_set_pos_on_route (const cda_rail::index_vector &edges_to_consider, const Network &network) const |
| Returns one interval that covers all selected edges on the route. | |
| std::optional< double > | get_first_pos_on_edges (const cda_rail::index_set &edge_indices, const Network &network) const |
| Returns where the first matching edge starts. | |
| std::optional< double > | get_last_pos_on_edges (const cda_rail::index_set &edge_indices, const Network &network) const |
| Returns where the last matching edge ends. | |
| size_t | get_edge_id_at_pos (double pos, const Network &network) const |
| Returns the edge that contains a given position on the route. | |
| size_t | get_edge_id (size_t route_index) const |
| Returns the edge id at a given route position. | |
| const Edge & | get_edge (size_t route_index, const Network &network) const |
| Returns the full edge object at a given route position. | |
| const Edge & | get_first_edge (const Network &network) const |
| Returns the first edge in the route. | |
| const Edge & | get_last_edge (const Network &network) const |
| Returns the last edge in the route. | |
| bool | contains_edge (size_t const edgeIndex) const |
| Checks whether an edge id appears in this route. | |
| bool | contains_edge (Network::EdgeInput const &edge_input, const Network &network) const |
| Checks whether a network edge appears in this route. | |
| bool | contains_edge (std::optional< size_t > const edgeIndex) const |
| Determines if an optional edge id is present in this route. | |
| void | push_back_edge (Network::EdgeInput const &new_edge, const Network &network) |
| Adds an edge at the end of the route. | |
| void | push_front_edge (Network::EdgeInput const &new_edge, const Network &network) |
| Adds an edge at the beginning of the route. | |
| void | remove_first_edge () |
| Removes the first edge from the route. | |
| void | remove_last_edge () |
| Removes the last edge from the route. | |
| bool | check_consistency (const Network &network) const |
| Checks whether the route is connected step by step. | |
| void | update_after_discretization (const std::vector< std::pair< size_t, cda_rail::index_vector > > &new_edges) |
| Updates the route after edge splitting in the network. | |
Ordered list of network edges that a train follows.
For a non-empty route, each next edge should be reachable from the previous one according to the network successor rules.
|
nodiscard |
Checks whether the route is connected step by step.
The route is consistent when every edge can directly continue to the next edge according to the network. Empty and single-edge routes are valid.
| network | Network used for successor checks. |
| cda_rail::exceptions::EdgeNotExistentException | If one of the checked route edges does not exist in network. |
|
inlinenodiscard |
Checks whether a network edge appears in this route.
| edge_input | Edge input resolved via network. |
| network | Network used for descriptor resolution. |
| cda_rail::exceptions::EdgeNotExistentException | If edge_input cannot be resolved to an existing edge. |
| cda_rail::exceptions::ConsistencyException | If edge_input is an Edge object that mismatches the stored edge attributes. |
|
inlinenodiscard |
Checks whether an edge id appears in this route.
| edgeIndex | The edge id to search for. |
|
inlinenodiscard |
Determines if an optional edge id is present in this route.
|
nodiscard |
Returns where a specific edge lies on this route.
| cda_rail::exceptions::EdgeNotExistentException | If edge does not exist in network. |
| cda_rail::exceptions::ConsistencyException | If the edge exists in network but is not part of this route. |
|
nodiscard |
Returns one interval that covers all selected edges on the route.
The function takes the earliest start and latest end among all route edges whose id is listed in edges_to_consider.
edges_to_consider occurs in this route. | cda_rail::exceptions::ConsistencyException | If no edge from edges_to_consider exists in this route. |
| cda_rail::exceptions::EdgeNotExistentException | If this route contains an edge that does not exist in network. |
|
inlinenodiscard |
Checks whether the route is empty.
|
nodiscard |
Returns the full edge object at a given route position.
| route_index | Index into route order. |
| network | Network containing all route edges. |
| cda_rail::exceptions::InvalidInputException | If route_index is out of range. |
| cda_rail::exceptions::EdgeNotExistentException | If the referenced edge id is not present in network. |
|
nodiscard |
Returns the edge id at a given route position.
| route_index | Index into route order. |
route_index. | cda_rail::exceptions::InvalidInputException | If route_index is out of range. |
|
nodiscard |
Returns the edge that contains a given position on the route.
| pos | Position in metres from route start. |
| network | Network used to read edge lengths. |
pos. | cda_rail::exceptions::InvalidInputException | If pos is negative. |
| cda_rail::exceptions::ConsistencyException | If pos lies outside the route interval [0, length(network)]. |
| cda_rail::exceptions::EdgeNotExistentException | If this route contains an edge that does not exist in network. |
|
inlinenodiscard |
Provides the edges forming the route in travel order.
Returns the first edge in the route.
| network | The network containing edge information. |
| InvalidInputException | If the route is empty. |
| EdgeNotExistentException | If the first edge's id does not exist in the network. |
|
nodiscard |
Returns where the first matching edge starts.
edge_indices, or std::nullopt if no such edge exists. | cda_rail::exceptions::EdgeNotExistentException | If this route contains an edge that does not exist in network. |
Returns the last edge in the route.
| InvalidInputException | If the route is empty. |
| EdgeNotExistentException | If the last edge id is not in the network. |
|
nodiscard |
Returns where the last matching edge ends.
edge_indices, or std::nullopt if no such edge exists. | cda_rail::exceptions::EdgeNotExistentException | If this route contains an edge that does not exist in network. |
|
nodiscard |
Returns the total route length.
| network | Network containing all edges referenced by this route. |
| cda_rail::exceptions::EdgeNotExistentException | If any referenced edge does not exist in network. |
| void cda_rail::Route::push_back_edge | ( | Network::EdgeInput const & | new_edge, |
| const Network & | network ) |
Adds an edge at the end of the route.
If the route is not empty, the new edge must be a valid next edge of the current last edge.
| cda_rail::exceptions::EdgeNotExistentException | If new_edge does not exist in network. |
| cda_rail::exceptions::ConsistencyException | If the route is non-empty and new_edge is not a valid successor of the current last edge. |
| void cda_rail::Route::push_front_edge | ( | Network::EdgeInput const & | new_edge, |
| const Network & | network ) |
Adds an edge at the beginning of the route.
If the route is not empty, the new edge must be a valid predecessor of the current first edge.
| new_edge | Edge descriptor to prepend. |
| network | Network used to resolve and validate new_edge. |
| cda_rail::exceptions::EdgeNotExistentException | If new_edge does not exist in network. |
| cda_rail::exceptions::ConsistencyException | If the route is non-empty and new_edge is not a valid predecessor of the current first edge. |
| void cda_rail::Route::remove_first_edge | ( | ) |
Removes the first edge from the route.
| cda_rail::exceptions::ConsistencyException | If the route is empty. |
| void cda_rail::Route::remove_last_edge | ( | ) |
Removes the last edge from the route.
| cda_rail::exceptions::ConsistencyException | If the route is empty. |
|
inlinenodiscard |
Gets the number of edges in the route.
| void cda_rail::Route::update_after_discretization | ( | const std::vector< std::pair< size_t, cda_rail::index_vector > > & | new_edges | ) |
Updates the route after edge splitting in the network.
For each pair (old_edge, replacement_edges) in new_edges, every occurrence of old_edge is replaced by all edges in replacement_edges, keeping the original travel order.
| new_edges | Mapping from original edge id to replacement edge sequence. |