Skip to content

Commit

Permalink
count odm transfers (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
mority authored Feb 21, 2025
1 parent cb852dc commit cb06524
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/journey_to_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "motis/constants.h"
#include "motis/gbfs/mode.h"
#include "motis/gbfs/routing_data.h"
#include "motis/odm/odm.h"
#include "motis/place.h"
#include "motis/street_routing.h"
#include "motis/tag_lookup.h"
Expand Down Expand Up @@ -84,7 +85,8 @@ api::Itinerary journey_to_response(osr::ways const* w,
decltype(j.legs_)::iterator>::difference_type>(0),
utl::count_if(j.legs_, [](auto&& leg) {
return holds_alternative<n::routing::journey::run_enter_exit>(
leg.uses_);
leg.uses_) ||
odm::is_odm_leg(leg);
}) - 1)};

auto const append = [&](api::Itinerary&& x) {
Expand Down
6 changes: 3 additions & 3 deletions src/odm/meta_router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ std::vector<meta_router::routing_result> meta_router::search_interval(
void collect_odm_journeys(
std::vector<meta_router::routing_result> const& results) {
p->odm_journeys_.clear();
for (auto& r : results | std::views::drop(1)) {
for (auto& j : r.journeys_) {
p->odm_journeys_.push_back(std::move(j));
for (auto const& r : results | std::views::drop(1)) {
for (auto const& j : r.journeys_) {
p->odm_journeys_.push_back(j);
}
}
fmt::println("[routing] collected {} ODM-PT journeys",
Expand Down

0 comments on commit cb06524

Please sign in to comment.