Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/routing/raptor/pong.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <ranges>

#include "utl/sorted_diff.h"
#include "utl/timing.h"

#include "nigiri/routing/get_earliest_transport.h"
#include "nigiri/rt/frun.h"
Expand Down Expand Up @@ -280,6 +281,7 @@ routing_result pong(timetable const& tt,
// ====
// PING
// ----
UTL_START_TIMING(ping_lb);
auto ping_lb = std::vector<std::uint16_t>{};
dijkstra(tt, q,
(kFwd ? tt.fwd_search_lb_graph_[q.prf_idx_]
Expand All @@ -291,6 +293,7 @@ routing_result pong(timetable const& tt,
: &(kFwd ? rtt->fwd_search_lb_graph_
: rtt->bwd_search_lb_graph_)),
ping_lb);
UTL_STOP_TIMING(ping_lb);

auto ping_dist_to_dest = std::vector<std::uint16_t>{};
auto ping_is_dest = bitvec{};
Expand Down Expand Up @@ -323,6 +326,7 @@ routing_result pong(timetable const& tt,
// ----
q.flip_dir();

UTL_START_TIMING(pong_lb);
auto pong_lb = std::vector<std::uint16_t>{};
dijkstra(tt, q,
(kFwd ? tt.bwd_search_lb_graph_[q.prf_idx_]
Expand All @@ -334,6 +338,7 @@ routing_result pong(timetable const& tt,
: &(kFwd ? rtt->bwd_search_lb_graph_
: rtt->fwd_search_lb_graph_)),
pong_lb);
UTL_STOP_TIMING(pong_lb);

auto pong_dist_to_dest = std::vector<std::uint16_t>{};
auto pong_is_dest = bitvec{};
Expand Down Expand Up @@ -368,10 +373,13 @@ routing_result pong(timetable const& tt,
// >> PLAY!
// --------
auto starts = std::vector<start>{};
auto result = routing_result{.journeys_ = &s_state.results_,
.interval_ = search_interval,
.search_stats_ = {},
.algo_stats_ = {}};
auto result = routing_result{
.journeys_ = &s_state.results_,
.interval_ = search_interval,
.search_stats_ = {.lb_time_ =
static_cast<std::uint64_t>(UTL_TIMING_MS(ping_lb)) +
static_cast<std::uint64_t>(UTL_TIMING_MS(pong_lb))},
.algo_stats_ = {}};
auto start_time =
kFwd ? search_interval.from_ : search_interval.to_ - duration_t{1};
auto const end_time =
Expand Down
Loading