diff --git a/features/support/hooks.js b/features/support/hooks.js index 01c2e6e89..7bd8116cb 100644 --- a/features/support/hooks.js +++ b/features/support/hooks.js @@ -51,7 +51,7 @@ module.exports = function () { .defer(rimraf, this.scenarioLogFile) .awaitAll(callback); // uncomment to get path to logfile - // console.log(' Writing logging output to ' + this.scenarioLogFile); + console.log(' Writing logging output to ' + this.scenarioLogFile); }); this.After((scenario, callback) => { diff --git a/features/testbot/distance_matrix.feature b/features/testbot/distance_matrix.feature index d97f50924..6d577c9e6 100644 --- a/features/testbot/distance_matrix.feature +++ b/features/testbot/distance_matrix.feature @@ -5,21 +5,44 @@ Feature: Basic Distance Matrix Background: Given the profile "testbot" And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16" + # Scenario: Testbot - Travel distance matrix of small grid + # Given the node map + # """ + # a b c + # d e f + # """ + + # And the ways + # | nodes | + # | abc | + # | def | + # | ad | + # | be | + # | cf | + + # When I request a travel distance matrix I should get + # | | a | b | e | f | + # | a | 0 | 100+-1 | 200+-1 | 300+-1 | + # | b | 100+-1 | 0 | 100+-1 | 200+-1 | + # | e | 200+-1 | 100+-1 | 0 | 100+-1 | + # | f | 300+-1 | 200+-1 | 100+-1 | 0 | Scenario: Testbot - Travel distance matrix of minimal network Given the node map """ - a b + a z + b """ And the ways | nodes | - | ab | + | az | + | zb | When I request a travel distance matrix I should get | | a | b | - | a | 0 | 100+-1 | - | b | 100+-1 | 0 | + | a | 0 | 400+-1 | + | b | 400+-1 | 0 | Scenario: Testbot - Travel distance matrix of minimal network with toll exclude Given the query options diff --git a/src/engine/routing_algorithms/many_to_many_mld.cpp b/src/engine/routing_algorithms/many_to_many_mld.cpp index c122a3a28..b943a10f7 100644 --- a/src/engine/routing_algorithms/many_to_many_mld.cpp +++ b/src/engine/routing_algorithms/many_to_many_mld.cpp @@ -64,6 +64,7 @@ void relaxOutgoingEdges(const DataFacade &facade, const auto &cell = cells.GetCell(metric, level, partition.GetCell(level, node)); if (DIRECTION == FORWARD_DIRECTION) { // Shortcuts in forward direction + // std::cout << "FORWARD_DIRECTION relaxOutgoingEdges" << std::endl; auto destination = cell.GetDestinationNodes().begin(); auto shortcut_durations = cell.GetOutDuration(node); auto shortcut_distances = cell.GetOutDistance(node); @@ -272,8 +273,8 @@ oneToManySearch(SearchEngineData &engine_working_data, const auto path_duration = duration + target_duration; const auto path_distance = distance + target_distance; - if (std::tie(path_weight, path_duration) < - std::tie(weights[index], durations[index])) + if (std::tie(path_weight, path_duration, path_distance) < + std::tie(weights[index], durations[index], distances_table[index])) { weights[index] = path_weight; durations[index] = path_duration; @@ -533,10 +534,13 @@ void forwardRoutingStep(const DataFacade &facade, std::vector &middle_nodes_table, const PhantomNode &phantom_node) { + std::cout << (DIRECTION == FORWARD_DIRECTION ? "forward_routing_step FORWARD_DIRECTION: " : "forward_routing_step REVERSE_DIRECTION: ") << std::endl; const auto node = query_heap.DeleteMin(); const auto source_weight = query_heap.GetKey(node); const auto source_duration = query_heap.GetData(node).duration; const auto source_distance = query_heap.GetData(node).distance; + std::cout << "source_duration: " << source_duration << std::endl; + std::cout << "source_distance: " << source_distance << std::endl; // Check if each encountered node has an entry const auto &bucket_list = std::equal_range(search_space_with_buckets.begin(), @@ -550,6 +554,9 @@ void forwardRoutingStep(const DataFacade &facade, const auto target_weight = current_bucket.weight; const auto target_duration = current_bucket.duration; const auto target_distance = current_bucket.distance; + std::cout << "target_duration: " << target_duration << std::endl; + std::cout << "target_distance: " << target_distance << std::endl; + // Get the value location in the results tables: // * row-major direct (row_idx, column_idx) index for forward direction @@ -574,6 +581,8 @@ void forwardRoutingStep(const DataFacade &facade, current_duration = new_duration; current_distance = new_distance; middle_nodes_table[location] = node; + std::cout << "new_duration: " << new_duration << std::endl; + std::cout << "new_distance: " << new_distance << std::endl; } } diff --git a/src/extractor/extraction_containers.cpp b/src/extractor/extraction_containers.cpp index aeb1a84c1..433a4d368 100644 --- a/src/extractor/extraction_containers.cpp +++ b/src/extractor/extraction_containers.cpp @@ -389,6 +389,7 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm const auto accurate_distance = util::coordinate_calculation::fccApproximateDistance(source_coord, target_coord); + std::cout << "accurate_distance: " << accurate_distance << std::endl; ExtractionSegment segment(source_coord, target_coord, distance, weight, duration); scripting_environment.ProcessSegment(segment);