diff --git a/profiles/car.lua b/profiles/car.lua index bf23e8044..a73980d91 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -120,6 +120,9 @@ function setup() -- classes to support for exclude flags excludable = Sequence { + Set {'toll'}, + Set {'motorway'}, + Set {'ferry'} }, avoid = Set { diff --git a/src/engine/routing_algorithms/many_to_many_mld.cpp b/src/engine/routing_algorithms/many_to_many_mld.cpp index f1ba43f00..08e52e3a7 100644 --- a/src/engine/routing_algorithms/many_to_many_mld.cpp +++ b/src/engine/routing_algorithms/many_to_many_mld.cpp @@ -121,7 +121,7 @@ void relaxOutgoingEdges(const DataFacade &facade, { query_heap.Insert(to, to_weight, {node, true, to_duration, to_distance}); } - else if (std::tie(to_weight, to_duration, node) < + else if (std::tie(to_weight, to_duration, to_distance, node) < std::tie(query_heap.GetKey(to), query_heap.GetData(to).duration, query_heap.GetData(to).distance, @@ -168,10 +168,7 @@ void relaxOutgoingEdges(const DataFacade &facade, // New Node discovered -> Add to Heap + Node Info Storage if (!query_heap.WasInserted(to)) { - query_heap.Insert( - to, - to_weight, - {node, false, to_duration, to_distance}); + query_heap.Insert(to, to_weight, {node, false, to_duration, to_distance}); } // Found a shorter Path -> Update weight and set new parent else if (std::tie(to_weight, to_duration, to_distance, node) < @@ -833,7 +830,7 @@ manyToManySearch(SearchEngineData &engine_working_data, const std::vector &phantom_nodes, const std::vector &source_indices, const std::vector &target_indices, - const bool calculate_distance) + const bool /*calculate_distance*/) { const auto number_of_sources = source_indices.size(); const auto number_of_targets = target_indices.size(); @@ -905,7 +902,8 @@ manyToManySearch(SearchEngineData &engine_working_data, source_phantom); } - if (calculate_distance) + // if (calculate_distance) + if (false) { distances_table.resize(number_of_entries, INVALID_EDGE_DISTANCE); calculateDistances(query_heap, diff --git a/test/nodejs/route.js b/test/nodejs/route.js index 67679d498..011a098a3 100644 --- a/test/nodejs/route.js +++ b/test/nodejs/route.js @@ -19,17 +19,17 @@ test('route: routes Monaco', function(assert) { }); }); -// test('route: routes Monaco on MLD', function(assert) { -// assert.plan(5); -// var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); -// osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) { -// assert.ifError(err); -// assert.ok(route.waypoints); -// assert.ok(route.routes); -// assert.ok(route.routes.length); -// assert.ok(route.routes[0].geometry); -// }); -// }); +test('route: routes Monaco on MLD', function(assert) { + assert.plan(5); + var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); + osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) { + assert.ifError(err); + assert.ok(route.waypoints); + assert.ok(route.routes); + assert.ok(route.routes.length); + assert.ok(route.routes[0].geometry); + }); +}); test('route: routes Monaco on CoreCH', function(assert) { assert.plan(5); @@ -566,31 +566,31 @@ test('route: throws on bad approaches', function(assert) { /Approach must be a string: \[curb, unrestricted\] or null/); }); -// test('route: routes Monaco with custom limits on MLD', function(assert) { -// assert.plan(2); -// var osrm = new OSRM({ -// path: monaco_mld_path, -// algorithm: 'MLD', -// max_alternatives: 10, -// }); -// osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) { -// assert.ifError(err); -// assert.ok(Array.isArray(route.routes)); -// }); -// }); +test('route: routes Monaco with custom limits on MLD', function(assert) { + assert.plan(2); + var osrm = new OSRM({ + path: monaco_mld_path, + algorithm: 'MLD', + max_alternatives: 10, + }); + osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) { + assert.ifError(err); + assert.ok(Array.isArray(route.routes)); + }); +}); -// test('route: in Monaco with custom limits on MLD', function(assert) { -// assert.plan(1); -// var osrm = new OSRM({ -// path: monaco_mld_path, -// algorithm: 'MLD', -// max_alternatives: 10, -// }); -// osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) { -// console.log(err) -// assert.equal(err.message, 'TooBig'); -// }); -// }); +test('route: in Monaco with custom limits on MLD', function(assert) { + assert.plan(1); + var osrm = new OSRM({ + path: monaco_mld_path, + algorithm: 'MLD', + max_alternatives: 10, + }); + osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) { + console.log(err) + assert.equal(err.message, 'TooBig'); + }); +}); test('route: route in Monaco without motorways', function(assert) { assert.plan(3); diff --git a/unit_tests/customizer/cell_customization.cpp b/unit_tests/customizer/cell_customization.cpp index b51e36797..d5a3f9eb8 100644 --- a/unit_tests/customizer/cell_customization.cpp +++ b/unit_tests/customizer/cell_customization.cpp @@ -27,6 +27,7 @@ auto makeGraph(const MultiLevelPartition &mlp, const std::vector &mock { EdgeWeight weight; EdgeDuration duration; + EdgeDistance distance; bool forward; bool backward; }; @@ -36,8 +37,20 @@ auto makeGraph(const MultiLevelPartition &mlp, const std::vector &mock for (const auto &m : mock_edges) { max_id = std::max(max_id, std::max(m.start, m.target)); - edges.push_back(Edge{m.start, m.target, m.weight, 2 * m.weight, true, false}); - edges.push_back(Edge{m.target, m.start, m.weight, 2 * m.weight, false, true}); + edges.push_back(Edge{m.start, + m.target, + m.weight, + 2 * m.weight, + static_cast(1.0), + true, + false}); + edges.push_back(Edge{m.target, + m.start, + m.weight, + 2 * m.weight, + static_cast(1.0), + false, + true}); } std::sort(edges.begin(), edges.end()); return partitioner::MultiLevelGraph(