Skip to content

Commit

Permalink
Add critical TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
ottoblep committed Jan 4, 2025
1 parent e0a6053 commit 8c553be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/simulation/TrainTrajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ cda_rail::sim::TrainTrajectory::read_initial_train_state() const {
.timestep = (u_int64_t)train_schedule.get_t_0(),
.edge =
instance.network.get_successors(train_schedule.get_entry()).front(),
// TODO: starting edge is not always directed away from starting vertex
.position = 0,
.orientation = true,
.speed = train_schedule.get_v_0()};
Expand Down
5 changes: 5 additions & 0 deletions src/simulation/TrainTrajectorySet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ std::optional<double> cda_rail::sim::TrainTrajectorySet::train_distance(

double edge_length2 = instance.network.get_edge(state2.edge).length;

// TODO: shortest path matrix only considers successors
// but trains can travel to predecessors even when unidirectional
// thus this distance is incorrect
double aepsp_metric1 =
instance.shortest_paths.at(state1.edge).at(state2.edge);
double aepsp_metric2 =
instance.shortest_paths.at(state2.edge).at(state1.edge);

// TODO: trains are not always traveling in edge direction even when
// unidirectional
double dist1 = aepsp_metric1 + (1 - state1.position) * edge_length1 -
(1 - state2.position) * edge_length2;
double dist2 = aepsp_metric2 + (1 - state2.position) * edge_length2 -
Expand Down

0 comments on commit 8c553be

Please sign in to comment.