From 350bc6f7560f37d3261fcffaad6fa643b455e891 Mon Sep 17 00:00:00 2001 From: Kajari Ghosh Date: Wed, 24 Jan 2018 11:30:26 -0500 Subject: [PATCH] Get actual paths for every entry in a matrix. --- features/support/hooks.js | 1 + .../routing_algorithms/many_to_many_ch.cpp | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/features/support/hooks.js b/features/support/hooks.js index 6b5185e9e..16911130c 100644 --- a/features/support/hooks.js +++ b/features/support/hooks.js @@ -46,6 +46,7 @@ module.exports = function () { // setup output logging let logDir = path.join(this.LOGS_PATH, this.featureID); this.scenarioLogFile = path.join(logDir, this.scenarioID) + '.log'; + console.log(this.scenarioLogFile); d3.queue(1) .defer(mkdirp, logDir) .defer(rimraf, this.scenarioLogFile) diff --git a/src/engine/routing_algorithms/many_to_many_ch.cpp b/src/engine/routing_algorithms/many_to_many_ch.cpp index 807406281..7e34a48d3 100644 --- a/src/engine/routing_algorithms/many_to_many_ch.cpp +++ b/src/engine/routing_algorithms/many_to_many_ch.cpp @@ -1,5 +1,6 @@ #include "engine/routing_algorithms/many_to_many.hpp" #include "engine/routing_algorithms/routing_base_ch.hpp" +#include "engine/routing_algorithms/direct_shortest_path.hpp" #include #include @@ -161,6 +162,7 @@ std::vector manyToManySearch(SearchEngineData &engi const std::vector &source_indices, const std::vector &target_indices) { + std::cout << 'Im in many to many search' << std::endl; const auto number_of_sources = source_indices.size(); const auto number_of_targets = target_indices.size(); const auto number_of_entries = number_of_sources * number_of_targets; @@ -168,6 +170,25 @@ std::vector manyToManySearch(SearchEngineData &engi std::vector weights_table(number_of_entries, INVALID_EDGE_WEIGHT); std::vector durations_table(number_of_entries, MAXIMAL_EDGE_DURATION); + for (std::uint32_t column_idx = 0; column_idx < target_indices.size(); ++column_idx) + { + const auto &target = phantom_nodes[target_indices[column_idx]]; + + for (std::uint32_t row_idx = 0; row_idx < source_indices.size(); ++row_idx) + { + const auto &source = phantom_nodes[source_indices[row_idx]]; + + PhantomNodes pair = {source, target}; + + InternalRouteResult result = directShortestPathSearch(engine_working_data, facade, pair); + + std::cout << 'column_idx ' << column_idx; + std::cout << ' row_idx ' << row_idx; + std::cout << ' duration' << result.duration() << std::endl; + + } + } + std::vector search_space_with_buckets; // Populate buckets with paths from all accessible nodes to destinations via backward searches