From 76c0099d9c04ba91b24ef85c68bd1a9eab8f8200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Wed, 15 Jan 2025 18:25:28 +0100 Subject: [PATCH] wip --- exe/generate.cc | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/exe/generate.cc b/exe/generate.cc index 7b92ce003..183febb11 100644 --- a/exe/generate.cc +++ b/exe/generate.cc @@ -23,7 +23,6 @@ #include "utl/sorted_diff.h" #include "utl/timing.h" -#include "nigiri/query_generator/generator.h" #include "nigiri/routing/query.h" #include "nigiri/timetable.h" @@ -109,31 +108,11 @@ int generate(int ac, char** av) { } { - auto gen = n::query_generation::generator{ - *d.tt_, - {.interval_size_ = n::duration_t{0U}, - .bbox_ = {}, - .start_match_mode_ = n::routing::location_match_mode::kEquivalent, - .dest_match_mode_ = n::routing::location_match_mode::kEquivalent, - .start_ = {}, - .dest_ = {}}, - 0U}; auto out = std::ofstream{"queries.txt"}; for (auto i = 0U; i != n; ++i) { - auto const q = gen.random_query(); - utl::verify(q.has_value(), "no query found"); - utl::verify(std::holds_alternative(q->start_), - "start not a location"); - utl::verify(std::holds_alternative(q->dest_), - "dest not a location"); - utl::verify( - std::holds_alternative>(q->q_.start_time_), - "start time not interval"); auto p = api::plan_params{}; - p.fromPlace_ = - d.tags_->id(*d.tt_, std::get(q->start_)); - p.toPlace_ = d.tags_->id(*d.tt_, std::get(q->dest_)); - p.time_ = std::get>(q->q_.start_time_).from_; + p.fromPlace_ = d.tags_->id(*d.tt_, random_stop(*d.tt_, stops)); + p.toPlace_ = d.tags_->id(*d.tt_, random_stop(*d.tt_, stops)); out << p.to_url("/api/v1/plan") << "\n"; } } @@ -311,13 +290,11 @@ int compare(int ac, char** av) { std::cout << "\n\n"; } }; - auto n_empty = 0U; auto n_consumed = 0U; auto const consume_if_finished = [&](info const& x) { if (!is_finished(x)) { return; } - n_empty += (x.responses_[0]->itineraries_.size() == 0U); print_differences(x); response_buf.erase(x.id_); ++n_consumed; @@ -354,7 +331,6 @@ int compare(int ac, char** av) { } } - std::cout << "empty ref: " << n_empty << "\n"; std::cout << "consumed: " << n_consumed << "\n"; std::cout << "buffered: " << response_buf.size() << "\n"; std::cout << " equal: " << n_equal << "\n";