From 66d9c43cc405e06800d41f803e4daeac31d67bf2 Mon Sep 17 00:00:00 2001 From: mority Date: Thu, 11 Apr 2024 09:50:07 +0200 Subject: [PATCH] Requested changes from review of PR #79 --- include/nigiri/query_generator/generator.h | 8 ++++---- include/nigiri/query_generator/transport_mode.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/nigiri/query_generator/generator.h b/include/nigiri/query_generator/generator.h index 99dc846f..4fbd24c1 100644 --- a/include/nigiri/query_generator/generator.h +++ b/include/nigiri/query_generator/generator.h @@ -15,9 +15,9 @@ struct timetable; namespace nigiri::query_generation { -constexpr static std::uint32_t const kMaxGenAttempts = 10000U; +constexpr auto const kMaxGenAttempts = 10000U; -constexpr static int const kTimeOfDayWeights[] = { +constexpr auto const kTimeOfDayWeights = std::array{ 1, // 01: 00:00 - 01:00 1, // 02: 01:00 - 02:00 1, // 03: 02:00 - 03:00 @@ -104,8 +104,8 @@ struct generator { std::uniform_int_distribution day_d_; std::uniform_int_distribution start_mode_range_d_; std::uniform_int_distribution dest_mode_range_d_; - std::discrete_distribution hours_d_{ - std::begin(kTimeOfDayWeights), std::end(kTimeOfDayWeights)}; + std::discrete_distribution hours_d_{begin(kTimeOfDayWeights), + end(kTimeOfDayWeights)}; std::uniform_int_distribution minutes_d_{0, 59}; std::uniform_int_distribution bearing_d_{0, 359}; }; diff --git a/include/nigiri/query_generator/transport_mode.h b/include/nigiri/query_generator/transport_mode.h index 6b17385b..b03fdf25 100644 --- a/include/nigiri/query_generator/transport_mode.h +++ b/include/nigiri/query_generator/transport_mode.h @@ -15,11 +15,11 @@ struct transport_mode { std::uint16_t max_duration_; // [minutes] }; -constexpr static transport_mode kWalk{ - .mode_id_ = 1, .speed_ = 50U, .max_duration_ = 15U}; -constexpr static transport_mode kBicycle{ - .mode_id_ = 2, .speed_ = 200U, .max_duration_ = 15U}; -constexpr static transport_mode kCar{ - .mode_id_ = 3, .speed_ = 800U, .max_duration_ = 15U}; +constexpr auto const kWalk = + transport_mode{.mode_id_ = 1, .speed_ = 50U, .max_duration_ = 15U}; +constexpr auto const kBicycle = + transport_mode{.mode_id_ = 2, .speed_ = 200U, .max_duration_ = 15U}; +constexpr auto const kCar = + transport_mode{.mode_id_ = 3, .speed_ = 800U, .max_duration_ = 15U}; } // namespace nigiri::query_generation \ No newline at end of file