Skip to content

Commit

Permalink
odm: remove tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Feb 8, 2025
1 parent 71520ca commit cc33fb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
1 change: 0 additions & 1 deletion include/motis/odm/mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct mixer {
std::vector<cost_threshold> walk_cost_;
std::vector<cost_threshold> taxi_cost_;
std::vector<cost_threshold> transfer_cost_;
nigiri::timetable const& tt_;
};

} // namespace motis::odm
7 changes: 3 additions & 4 deletions src/odm/meta_router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ static auto const kReqHeaders = std::map<std::string, std::string>{
constexpr auto const kInfinityDuration =
n::duration_t{std::numeric_limits<n::duration_t::rep>::max()};

mixer get_odm_mixer(n::timetable const& tt) {
mixer get_odm_mixer() {
return mixer{.alpha_ = 1.5,
.beta_ = 0.39,
.walk_cost_ = {{0, 1}, {15, 10}},
.taxi_cost_ = {{0, 35}, {1, 12}},
.transfer_cost_ = {{0, 10}},
.tt_ = tt};
.transfer_cost_ = {{0, 10}}};
}

using td_offsets_t =
Expand Down Expand Up @@ -634,7 +633,7 @@ api::plan_response meta_router::run() {
}
fmt::println("[mixing] {} PT journeys and {} ODM journeys",
pt_result.journeys_.size(), p->odm_journeys_.size());
get_odm_mixer(*r_.tt_).mix(pt_result.journeys_, p->odm_journeys_);
get_odm_mixer().mix(pt_result.journeys_, p->odm_journeys_);
print_time(mixing_start, "[mixing]");

return {.from_ = from_place_,
Expand Down
34 changes: 0 additions & 34 deletions src/odm/mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ void mixer::productivity_domination(std::vector<journey>& odm_journeys) const {
};

auto const taxi_time = [&](journey const& j) -> double {
if (j.legs_.empty()) {
std::cout << "TAXI TIME: NO LEGS\n";
j.print(std::cout, tt_, nullptr, false);
}
return (j.legs_.empty() ? 0
: is_odm_leg(j.legs_.front())
? std::get<n::routing::offset>(j.legs_.front().uses_)
Expand Down Expand Up @@ -152,38 +148,8 @@ void mixer::productivity_domination(std::vector<journey>& odm_journeys) const {

void mixer::mix(n::pareto_set<journey> const& pt_journeys,
std::vector<journey>& odm_journeys) const {
std::cout << "ODM JOURNEYS:\n";
for (auto const& j : odm_journeys) {
if (j.legs_.empty()) {
std::cout << "NO LEGS\n";
}
j.print(std::cout, tt_, nullptr, false);
std::cout << "\n\n";
}
std::cout << "-----\n";

cost_domination(pt_journeys, odm_journeys);
std::cout << "COST DOMINATION:\n";
for (auto const& j : odm_journeys) {
if (j.legs_.empty()) {
std::cout << "NO LEGS\n";
}
j.print(std::cout, tt_, nullptr, false);
std::cout << "\n\n";
}
std::cout << "-----\n";

productivity_domination(odm_journeys);
std::cout << "PRODUCTIVITY DOMINATION:\n";
for (auto const& j : odm_journeys) {
if (j.legs_.empty()) {
std::cout << "NO LEGS\n";
}
j.print(std::cout, tt_, nullptr, false);
std::cout << "\n\n";
}
std::cout << "-----\n";

for (auto const& j : pt_journeys) {
odm_journeys.emplace_back(j);
}
Expand Down

0 comments on commit cc33fb1

Please sign in to comment.