debug cucumber accuracy errors

This commit is contained in:
Kajari Ghosh 2018-10-05 10:11:11 -04:00
parent 6d17b290fd
commit d848a72bba
4 changed files with 40 additions and 7 deletions

View File

@ -51,7 +51,7 @@ module.exports = function () {
.defer(rimraf, this.scenarioLogFile) .defer(rimraf, this.scenarioLogFile)
.awaitAll(callback); .awaitAll(callback);
// uncomment to get path to logfile // 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) => { this.After((scenario, callback) => {

View File

@ -5,21 +5,44 @@ Feature: Basic Distance Matrix
Background: Background:
Given the profile "testbot" Given the profile "testbot"
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16" 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 Scenario: Testbot - Travel distance matrix of minimal network
Given the node map Given the node map
""" """
a b a z
b
""" """
And the ways And the ways
| nodes | | nodes |
| ab | | az |
| zb |
When I request a travel distance matrix I should get When I request a travel distance matrix I should get
| | a | b | | | a | b |
| a | 0 | 100+-1 | | a | 0 | 400+-1 |
| b | 100+-1 | 0 | | b | 400+-1 | 0 |
Scenario: Testbot - Travel distance matrix of minimal network with toll exclude Scenario: Testbot - Travel distance matrix of minimal network with toll exclude
Given the query options Given the query options

View File

@ -64,6 +64,7 @@ void relaxOutgoingEdges(const DataFacade<mld::Algorithm> &facade,
const auto &cell = cells.GetCell(metric, level, partition.GetCell(level, node)); const auto &cell = cells.GetCell(metric, level, partition.GetCell(level, node));
if (DIRECTION == FORWARD_DIRECTION) if (DIRECTION == FORWARD_DIRECTION)
{ // Shortcuts in forward direction { // Shortcuts in forward direction
// std::cout << "FORWARD_DIRECTION relaxOutgoingEdges" << std::endl;
auto destination = cell.GetDestinationNodes().begin(); auto destination = cell.GetDestinationNodes().begin();
auto shortcut_durations = cell.GetOutDuration(node); auto shortcut_durations = cell.GetOutDuration(node);
auto shortcut_distances = cell.GetOutDistance(node); auto shortcut_distances = cell.GetOutDistance(node);
@ -272,8 +273,8 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
const auto path_duration = duration + target_duration; const auto path_duration = duration + target_duration;
const auto path_distance = distance + target_distance; const auto path_distance = distance + target_distance;
if (std::tie(path_weight, path_duration) < if (std::tie(path_weight, path_duration, path_distance) <
std::tie(weights[index], durations[index])) std::tie(weights[index], durations[index], distances_table[index]))
{ {
weights[index] = path_weight; weights[index] = path_weight;
durations[index] = path_duration; durations[index] = path_duration;
@ -533,10 +534,13 @@ void forwardRoutingStep(const DataFacade<Algorithm> &facade,
std::vector<NodeID> &middle_nodes_table, std::vector<NodeID> &middle_nodes_table,
const PhantomNode &phantom_node) 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 node = query_heap.DeleteMin();
const auto source_weight = query_heap.GetKey(node); const auto source_weight = query_heap.GetKey(node);
const auto source_duration = query_heap.GetData(node).duration; const auto source_duration = query_heap.GetData(node).duration;
const auto source_distance = query_heap.GetData(node).distance; 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 // Check if each encountered node has an entry
const auto &bucket_list = std::equal_range(search_space_with_buckets.begin(), const auto &bucket_list = std::equal_range(search_space_with_buckets.begin(),
@ -550,6 +554,9 @@ void forwardRoutingStep(const DataFacade<Algorithm> &facade,
const auto target_weight = current_bucket.weight; const auto target_weight = current_bucket.weight;
const auto target_duration = current_bucket.duration; const auto target_duration = current_bucket.duration;
const auto target_distance = current_bucket.distance; 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: // Get the value location in the results tables:
// * row-major direct (row_idx, column_idx) index for forward direction // * row-major direct (row_idx, column_idx) index for forward direction
@ -574,6 +581,8 @@ void forwardRoutingStep(const DataFacade<Algorithm> &facade,
current_duration = new_duration; current_duration = new_duration;
current_distance = new_distance; current_distance = new_distance;
middle_nodes_table[location] = node; middle_nodes_table[location] = node;
std::cout << "new_duration: " << new_duration << std::endl;
std::cout << "new_distance: " << new_distance << std::endl;
} }
} }

View File

@ -389,6 +389,7 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm
const auto accurate_distance = const auto accurate_distance =
util::coordinate_calculation::fccApproximateDistance(source_coord, target_coord); 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); ExtractionSegment segment(source_coord, target_coord, distance, weight, duration);
scripting_environment.ProcessSegment(segment); scripting_environment.ProcessSegment(segment);