|
| | EventSimulator (cda_rail::instances::GeneralPerformanceOptimizationInstance const &instance, std::vector< cda_rail::index_set > ttd_sections) |
| | Constructs an event-based simulator from an instance and TTD sections.
|
| | EventSimulator (cda_rail::instances::GeneralPerformanceOptimizationInstance const &instance, std::vector< cda_rail::index_set > ttd_sections, std::vector< cda_rail::index_vector > train_edges, std::vector< cda_rail::index_vector > ttd_orders, std::vector< cda_rail::index_vector > vertex_orders, std::vector< std::vector< double > > stop_positions) |
| | Constructs an event-based simulator with explicit state vectors.
|
| | EventSimulator (EventSimulator const &)=default |
| | Copy constructor.
|
| | EventSimulator (EventSimulator &&)=default |
| | Move constructor.
|
| EventSimulator & | operator= (EventSimulator const &)=default |
| | Copy assignment operator.
|
| EventSimulator & | operator= (EventSimulator &&)=default |
| | Move assignment operator.
|
| | ~EventSimulator () override=default |
| | Virtual destructor.
|
| instances::GeneralPerformanceOptimizationInstance const * | get_instance () const override |
| | Retrieves the typed performance optimization instance.
|
| SimulatorResults | simulate (double dt, bool late_entry_possible, bool limit_speed_by_leaving_edges, bool save_trajectories, bool block_vertices_after_disappearing) const override |
| | Runs the event-based simulation.
|
| SimulatorResults | simulate (double dt=6.0, bool late_entry_possible=false, bool limit_speed_by_leaving_edges=true, bool save_trajectories=false) const |
| | Simulates with default values, in particular a time step of 6 seconds and blocking the last vertex of a partial route.
|
| | GeneralSimulator (instances::GeneralProblemInstanceWithScheduleAndRoutes &instance, std::vector< cda_rail::index_set > ttd_sections) |
| | Constructs a simulator from a mutable instance reference.
|
| | GeneralSimulator (instances::GeneralProblemInstanceWithScheduleAndRoutes &instance, std::vector< cda_rail::index_set > ttd_sections, std::vector< cda_rail::index_vector > train_edges, std::vector< cda_rail::index_vector > ttd_orders, std::vector< cda_rail::index_vector > vertex_orders, std::vector< std::vector< double > > stop_positions) |
| | Constructs a simulator from explicit state vectors.
|
| virtual | ~GeneralSimulator ()=default |
| | Virtual destructor.
|
| | GeneralSimulator (GeneralSimulator const &)=default |
| | Copy constructor.
|
| | GeneralSimulator (GeneralSimulator &&)=default |
| | Move constructor.
|
| GeneralSimulator & | operator= (GeneralSimulator const &)=default |
| | Copy assignment operator.
|
| GeneralSimulator & | operator= (GeneralSimulator &&)=default |
| | Move assignment operator.
|
| const std::vector< cda_rail::index_set > & | get_ttd_sections () const |
| | Retrieves the TTD sections considered by the simulator.
|
| const std::vector< cda_rail::index_vector > & | get_train_edges () const |
| | Accesses the edge sequences for all trains.
|
| const cda_rail::index_vector & | get_train_edges_of_tr (size_t train_id) const |
| | Returns the current edge sequence for one train.
|
| const std::vector< cda_rail::index_vector > & | get_ttd_orders () const |
| | Retrieves the ordering vectors for all TTD sections.
|
| const cda_rail::index_vector & | get_ttd_orders_of_ttd (size_t ttd_index) const |
| | Returns the train order for one TTD section.
|
| std::optional< size_t > | get_ttd (Network::EdgeInput const &edge) const |
| | Returns the TTD section containing an edge, if any.
|
| const std::vector< cda_rail::index_vector > & | get_vertex_orders () const |
| | Accesses the train ordering for each vertex.
|
| const cda_rail::index_vector & | get_vertex_orders_of_vertex (Network::VertexInput const &vertex) const |
| | Returns the train order stored for a vertex.
|
| const std::vector< std::vector< double > > & | get_stop_positions () const |
| | Accesses all trains' scheduled stop positions.
|
| const std::vector< double > & | get_stop_positions_of_tr (size_t train_id) const |
| | Returns the stop positions of one train.
|
| double | train_edge_length (size_t tr) const |
| | Returns the length of the current edge sequence of a train.
|
| double | get_edge_position (size_t train_id, size_t edge_id) const |
| | Returns the route position at which an edge ends, i.e., the position of its target vertex.
|
| size_t | get_edge_at_position (size_t train_id, double position) const |
| | Returns the edge that contains a route position.
|
| bool | is_route_end_valid_stop_pos (size_t tr, const cda_rail::index_vector &edges) const |
| | Checks whether a route end can serve as the next stop position.
|
| bool | is_current_pos_valid_stop_position (size_t tr) const |
| | Checks whether the train's current last edge is a valid stop position.
|
| SimulatorState | get_simulator_state () const |
| | The full simulator state.
|
| void | set_simulator_state (SimulatorState state) |
| | Replaces the full simulator state.
|
| void | set_train_edges (std::vector< cda_rail::index_vector > tr_edges) |
| | Replaces all train edge sequences.
|
| void | set_train_edges_of_tr (size_t train_id, cda_rail::index_vector edges) |
| | Replaces the edge sequence of one train.
|
| void | append_train_edge_to_tr (size_t train_id, cda_rail::Network::EdgeInput const &edge) |
| | Appends one edge to a train edge sequence.
|
| void | set_ttd_orders (std::vector< cda_rail::index_vector > orders) |
| | Replaces all TTD train orders.
|
| void | set_ttd_orders_of_ttd (size_t ttd_index, cda_rail::index_vector orders) |
| | Replaces the order stored for one TTD section.
|
| void | set_vertex_orders (std::vector< cda_rail::index_vector > orders) |
| | Replaces all vertex train orders.
|
| void | set_vertex_orders_of_vertex (cda_rail::Network::VertexInput const &vertex, cda_rail::index_vector orders) |
| | Replaces the train order stored for one vertex.
|
| void | set_stop_positions (std::vector< std::vector< double > > positions) |
| | Replaces all stop-position vectors.
|
| void | set_stop_positions_of_tr (size_t train_id, std::vector< double > positions) |
| | Replaces the stop positions of one train.
|
| void | append_stop_position_to_tr (size_t train_id, double position) |
| | Appends one stop position to a train.
|
| void | append_stop_edge_to_tr (size_t train_id, size_t edge) |
| | Appends a stop edge reference to a train.
|
| void | append_current_stop_position_of_tr (size_t train_id) |
| | Appends the current route-end position as a stop for a train.
|
| bool | is_final_state () const |
| | Checks whether the current simulator state is terminal.
|
| SimulatorResults | simulate (double dt=6.0, bool late_entry_possible=false, bool limit_speed_by_leaving_edges=true, bool save_trajectories=false) const |
| | Simulates with default values, in particular a time step of 6 seconds and blocking the last vertex of a partial route.
|
| virtual std::optional< SimulatorState > | first_come_first_served_state (double dt, bool late_entry_possible, bool limit_speed_by_leaving_edges) const |
| | Decides every order that the current state leaves open first come, first served.
|
| cda_rail::index_set | trains_on_path (cda_rail::index_vector const &edges, bool also_reverse_path=false) const |
| | Returns the trains whose current routes contain a path.
|
| cda_rail::index_set | trains_on_path (cda_rail::index_vector const &edges, std::vector< cda_rail::index_vector > const &tr_edges, bool also_reverse_path=false) const |
| | Returns the trains from provided routes that contain a path.
|
Simulates the trains of a moving block instance event by event.
The trains drive by the same rules as in the GreedySimulator. Instead of advancing all trains in time steps of a fixed length, however, a train plans its fastest movement up to the end of its movement authority and is only simulated again once something relevant to it happens, e.g., once it has reached a stop or once the train it waits for has passed. Trains that wait for another train are woken up by that train.
Hence, the trajectories are exact, apart from one approximation: if a train's movement authority ends at the rear of the train ahead, it plans as if that rear stayed where it is. It is simulated again once it starts to brake, but at the earliest after dt seconds, see simulate.
The simulator is based on Sebastian Ludwig's bachelor's thesis "Event-Based Simulation of Modern Railway Networks", Technical University of Munich, 2026.