Allow specifing a weight for routing that is independent of duration

This commit is contained in:
Patrick Niklaus
2016-05-12 18:50:10 +02:00
committed by Patrick Niklaus
parent e463733138
commit 279f8aabfb
85 changed files with 2100 additions and 853 deletions
-127
View File
@@ -1,127 +0,0 @@
@routing @speed @traffic
Feature: Traffic - speeds
Background: Use specific speeds
Scenario: Weighting based on speed file
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,27
4,1,27
"""
And I route I should get
| from | to | route | speed |
| a | b | ad,de,eb,eb | 30 km/h |
| a | c | ad,dc,dc | 31 km/h |
| b | c | bc,bc | 27 km/h |
| a | d | ad,ad | 27 km/h |
| d | c | dc,dc | 36 km/h |
| g | b | fb,fb | 36 km/h |
| a | g | ad,df,fb,fb | 30 km/h |
Scenario: Speeds that isolate a single node (a)
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
| h | 2.075 | 19.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,0
4,1,0
"""
And I route I should get
| from | to | route | speed |
| a | b | fb,fb | 36 km/h |
| a | c | fb,bc,bc | 30 km/h |
| b | c | bc,bc | 27 km/h |
| a | d | fb,df,df | 36 km/h |
| d | c | dc,dc | 36 km/h |
| g | b | fb,fb | 36 km/h |
| a | g | fb,fb | 36 km/h |
Scenario: Verify that negative values cause an error, they're not valid at all
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
| h | 1.075 | 10.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the speed file
"""
1,2,-10
2,1,-20
2,3,27
3,2,27
1,4,-3
4,1,-5
"""
And the data has been extracted
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
And stderr should contain "malformed"
And it should exit with an error
+1 -1
View File
@@ -24,5 +24,5 @@ Feature: osrm-contract command line options: invalid options
Scenario: osrm-contract - Someone forgot --generate-edge-lookup on osrm-extract
When I try to run "osrm-contract --segment-speed-file /dev/null {processed_file}"
Then stderr should contain "Error while trying to mmap"
Then stderr should contain ".osrm.edge_penalties"
Then stderr should contain ".osrm.turn_penalties_index"
And it should exit with an error
+5 -4
View File
@@ -27,7 +27,7 @@ end
Scenario: Out-bound API version
Given the profile file
"""
api_version = 1
api_version = 2
"""
And the node map
"""
@@ -55,6 +55,7 @@ properties.max_speed_for_map_matching = 180/3.6
properties.use_turn_restrictions = true
properties.continue_straight_at_waypoint = true
properties.left_hand_driving = false
properties.weight_name = 'duration'
function node_function (node, result)
print ('node_function ' .. node:id())
@@ -71,7 +72,7 @@ end
function turn_function (angle)
print('turn_function ' .. angle)
return angle == 0 and 0 or 42
return angle == 0 and 0 or 17
end
function segment_function (source, target, distance, weight)
@@ -101,6 +102,6 @@ end
When I route I should get
| from | to | route | time |
| a | b | ac,cb,cb | 19.2s |
| a | d | ac,cd,cd | 19.2s |
| a | b | ac,cb,cb | 16.7s |
| a | d | ac,cd,cd | 16.7s |
| a | e | ac,ce,ce | 20s |
@@ -0,0 +1,66 @@
Feature: Profile API version 1
Background:
Given a grid size of 100 meters
Scenario: Basic profile function calls and property values
Given the profile file
"""
api_version = 1
-- set profile properties
properties.max_speed_for_map_matching = 180/3.6
properties.use_turn_restrictions = true
properties.continue_straight_at_waypoint = true
properties.weight_name = 'test_version1'
function node_function (node, result)
print ('node_function ' .. node:id())
end
function way_function(way, result)
result.name = way:get_value_by_key('name')
result.weight = 10
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.forward_speed = 36
result.backward_speed = 36
print ('way_function ' .. way:id() .. ' ' .. result.name)
end
function turn_function (turn)
print('turn_function', turn.angle, turn.turn_type, turn.direction_modifier, turn.has_traffic_light)
turn.weight = turn.angle == 0 and 0 or 4.2
turn.duration = turn.weight
end
function segment_function (segment)
print ('segment_function ' .. segment.source.lon .. ' ' .. segment.source.lat)
end
"""
And the node map
"""
a
bcd
e
"""
And the ways
| nodes |
| ac |
| cb |
| cd |
| ce |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
And stdout should contain "node_function"
And stdout should contain "way_function"
And stdout should contain "turn_function"
And stdout should contain "segment_function"
When I route I should get
| from | to | route | time |
| a | b | ac,cb,cb | 19.2s |
| a | d | ac,cd,cd | 19.2s |
| a | e | ac,ce,ce | 20s |
+18 -4
View File
@@ -164,15 +164,21 @@ module.exports = function () {
};
this.annotationList = (instructions) => {
function zip(list_1, list_2, list_3)
if (!('annotation' in instructions.legs[0]))
return '';
function zip(list_1, list_2, list_3, list_4)
{
let tuples = [];
for (let i = 0; i < list_1.length; ++i) {
tuples.push([list_1[i], list_2[i], list_3[i]]);
for (let i = 0; i < list_1.length; ++i) {
tuples.push([list_1[i], list_2[i], list_3[i], list_4[i]]);
}
return tuples;
}
return instructions.legs.map(l => {return zip(l.annotation.duration, l.annotation.distance, l.annotation.datasources).map(p => { return p.join(':'); }).join(','); }).join(',');
return instructions.legs.map(l => {
const values = zip( l.annotation.weight, l.annotation.duration, l.annotation.distance, l.annotation.datasources);
return values.map(p => { return p.join(':'); }).join(',');
}).join(',');
};
this.OSMIDList = (instructions) => {
@@ -250,4 +256,12 @@ module.exports = function () {
this.distanceList = (instructions) => {
return this.extractInstructionList(instructions, s => s.distance + 'm');
};
this.weightName = (instructions) => {
return instructions ? instructions.weight_name : '';
};
this.weightList = (instructions) => {
return this.extractInstructionList(instructions, s => s.weight);
};
};
+10 -1
View File
@@ -35,7 +35,7 @@ module.exports = function () {
if (err) return cb(err);
if (body && body.length) {
let destinations, pronunciations, instructions, refs, bearings, turns, modes, times,
distances, summary, intersections, lanes, locations;
distances, summary, intersections, lanes, locations, annotation, weight_name, weights;
let json = JSON.parse(body);
@@ -55,6 +55,9 @@ module.exports = function () {
lanes = this.lanesList(json.routes[0]);
summary = this.summary(json.routes[0]);
locations = this.locations(json.routes[0]);
annotation = this.annotationList(json.routes[0]);
weight_name = this.weightName(json.routes[0]);
weights = this.weightList(json.routes[0]);
}
if (headers.has('status')) {
@@ -130,6 +133,10 @@ module.exports = function () {
got.locations = (locations || '').trim();
}
if (headers.has('annotation')){
got.annotation = (annotation || '').trim();
}
var putValue = (key, value) => {
if (headers.has(key)) got[key] = instructions ? value : '';
};
@@ -142,6 +149,8 @@ module.exports = function () {
putValue('distances', distances);
putValue('pronunciations', pronunciations);
putValue('destinations', destinations);
putValue('weight_name', weight_name);
putValue('weights', weights);
}
for (var key in row) {
+3 -4
View File
@@ -141,9 +141,9 @@ Feature: Basic Map Matching
And the contract extra arguments "--segment-speed-file {speeds_file}"
When I match I should get
| trace | matchings | annotation |
| abeh | abeh | 1:10.008842:1,0:0:0,1:10.008842:0,1:10.008842:0,1:10.008842:0,0:0:0,2:19.906475:0,1:10.008842:0 |
| abci | abci | 1:10.008842:1,0:0:0,1:10.008842:0,0:0:0,1:10.010367:0 |
| trace | matchings | annotation |
| abeh | abeh | 1:1:10.008842:1,0:0:0:0,1:1:10.008842:0,1:1:10.008842:0,1:1:10.008842:0,0:0:0:0,2:2:19.906475:0,1:1:10.008842:0 |
| abci | abci | 1:1:10.008842:1,0:0:0:0,1:1:10.008842:0,0:0:0:0,1:1:10.010367:0 |
# The following is the same as the above, but separated for readability (line length)
When I match I should get
@@ -337,4 +337,3 @@ Feature: Basic Map Matching
| trace | OSM IDs |
| 12 | 1,2,3,4,5,6 |
| 21 | 6,5,4,3,2,1 |
+8 -14
View File
@@ -9,13 +9,10 @@ Feature: Testbot - side bias
"""
Scenario: Left hand bias
Given the profile file "testbot" extended with
Given the profile file "car" extended with
"""
properties.left_hand_driving = true
function turn_function (angle)
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
return (angle >= 0) and k * 1.2 or k / 1.2
end
turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
"""
Given the node map
"""
@@ -31,17 +28,14 @@ Feature: Testbot - side bias
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 82s +-1 |
| d | c | bd,bc,bc | 100s +-1 |
| d | a | bd,ab,ab | 29s +-1 |
| d | c | bd,bc,bc | 33s +-1 |
Scenario: Right hand bias
Given the profile file "testbot" extended with
Given the profile file "car" extended with
"""
properties.left_hand_driving = false
function turn_function (angle)
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
return (angle >= 0) and k / 1.2 or k * 1.2
end
turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
"""
And the node map
"""
@@ -57,8 +51,8 @@ Feature: Testbot - side bias
When I route I should get
| from | to | route | time |
| d | a | bd,ab,ab | 100s +-1 |
| d | c | bd,bc,bc | 82s +-1 |
| d | a | bd,ab,ab | 33s +-1 |
| d | c | bd,bc,bc | 29s +-1 |
Scenario: Roundabout exit counting for left sided driving
And a grid size of 10 meters
+132
View File
@@ -0,0 +1,132 @@
@routing @speed @traffic
Feature: Traffic - speeds
Background: Use specific speeds
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | 0.05 | 0.1 |
| c | 0.0 | 0.1 |
| d | 0.05 | 0.03 |
| e | 0.05 | 0.066 |
| f | 0.075 | 0.066 |
| g | 0.075 | 0.1 |
And the ways
| nodes | highway |
| ab | primary |
| ad | primary |
| bc | primary |
| dc | primary |
| de | primary |
| eb | primary |
| df | primary |
| fb | primary |
And the profile "testbot"
And the extract extra arguments "--generate-edge-lookup"
Scenario: Weighting based on speed file
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,27
4,1,27
"""
And I route I should get
| from | to | route | speed | weights |
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 |
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 |
| b | c | bc,bc | 27 km/h | 741.5,0 |
| a | d | ad,ad | 27 km/h | 1275.7,0 |
| d | c | dc,dc | 36 km/h | 956.8,0 |
| g | b | fb,fb | 36 km/h | 164.7,0 |
| a | g | ad,df,fb,fb | 30 km/h | 1275.7,487.5,304.7,0 |
Scenario: Weighting based on speed file weights, ETA based on file durations
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,1,200207
2,1,1,200207
2,3,27,7415
3,2,27,7415
1,4,27,12757
4,1,27,12757
"""
And I route I should get
| from | to | route | speed | weights |
| a | b | ad,de,eb,eb | 30 km/h | 1275.7,400.4,378.2,0 |
| a | c | ad,dc,dc | 31 km/h | 1275.7,956.8,0 |
| b | c | bc,bc | 27 km/h | 741.5,0 |
| a | d | ad,ad | 27 km/h | 1275.7,0 |
| d | c | dc,dc | 36 km/h | 956.8,0 |
| g | b | ab,ab | 1 km/h | 10010.4,0 |
| a | g | ab,ab | 1 km/h | 10010.3,0 |
Scenario: Weighting based on speed file weights, ETA based on file durations
Given the contract extra arguments "--segment-speed-file {speeds_file}"
Given the speed file
"""
1,2,1,200207
2,1,1,200207
2,3,27,7415
3,2,27,7415
1,4,1,344450
4,1,1,344450
"""
And I route I should get
| from | to | route | speed | weights |
| a | b | ab,ab | 1 km/h | 20020.7,0 |
| a | c | ab,bc,bc | 2 km/h | 20020.7,741.5,0 |
| b | c | bc,bc | 27 km/h | 741.5,0 |
| a | d | ab,eb,de,de | 2 km/h | 20020.7,378.2,400.4,0 |
| d | c | dc,dc | 36 km/h | 956.8,0 |
| g | b | ab,ab | 1 km/h | 10010.4,0 |
| a | g | ab,ab | 1 km/h | 10010.3,0 |
Scenario: Speeds that isolate a single node (a)
Given the contract extra arguments "--segment-speed-file {speeds_file}"
And the node locations
| node | lat | lon |
| h | 2.075 | 19.1 |
Given the speed file
"""
1,2,0
2,1,0
2,3,27
3,2,27
1,4,0
4,1,0
"""
And I route I should get
| from | to | route | speed | weights |
| a | b | fb,fb | 36 km/h | 329.4,0 |
| a | c | fb,bc,bc | 30 km/h | 329.4,741.5,0 |
| b | c | bc,bc | 27 km/h | 741.5,0 |
| a | d | fb,df,df | 36 km/h | 140,487.5,0 |
| d | c | dc,dc | 36 km/h | 956.8,0 |
| g | b | fb,fb | 36 km/h | 164.7,0 |
| a | g | fb,fb | 36 km/h | 164.7,0 |
Scenario: Verify that negative values cause an error, they're not valid at all
Given the speed file
"""
1,2,-10
2,1,-20
2,3,27
3,2,27
1,4,-3
4,1,-5
"""
And the data has been extracted
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
And stderr should contain "malformed"
And it should exit with an error
@@ -37,14 +37,30 @@ Feature: Traffic - turn penalties applied to turn onto which a phantom node snap
Given the turn penalty file
"""
1,2,5,0,comment
3,4,7,-20
3,4,7,-30
"""
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get
| from | to | route | speed | time |
| a | e | ab,be,be | 36 km/h | 40s +-1 |
| 1 | e | ab,be,be | 36 km/h | 30s +-1 |
| b | f | bc,cf,cf | 36 km/h | 40s +-1 |
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 |
| c | g | cd,dg,dg | 71 km/h | 20s +-1 |
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 |
| from | to | route | speed | time |
| a | e | ab,be,be | 36 km/h | 40s +-1 |
| 1 | e | ab,be,be | 36 km/h | 30s +-1 |
| b | f | bc,cf,cf | 36 km/h | 40s +-1 |
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 |
| c | g | cd,dg,dg | 144 km/h | 10s +-1 |
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 |
Scenario: Weighting based on turn penalty file with weights
Given the turn penalty file
"""
1,2,5,0,-3.33,comment
3,4,7,-30,100.75
"""
And the contract extra arguments "--turn-penalty-file {penalties_file}"
When I route I should get
| from | to | route | speed | time | weights |
| a | e | ab,be,be | 36 km/h | 40s +-1 | 16.7,20,0 |
| 1 | e | ab,be,be | 36 km/h | 30s +-1 | 6.7,20,0 |
| b | f | bc,cf,cf | 36 km/h | 40s +-1 | 20,20,0 |
| 2 | f | bc,cf,cf | 36 km/h | 30s +-1 | 10,20,0 |
| c | g | cd,dg,dg | 144 km/h | 10s +-1 | 120.8,20,0 |
| 3 | g | cd,dg,dg | 54 km/h | 20s +-1 | 110.8,20,0 |
+262
View File
@@ -0,0 +1,262 @@
@testbot
Feature: Weight tests
Background:
Given the profile "testbot"
Given a grid size of 10 meters
Given the extract extra arguments "--generate-edge-lookup"
Given the query options
| geometries | geojson |
Scenario: Weight details
Given the query options
| annotations | true |
Given the node map
"""
s
·
a---b---c
|
d
|··t
e
"""
And the ways
| nodes |
| abc |
| cde |
When I route I should get
| waypoints | route | annotation |
| s,t | abc,cde,cde | 1.1:1.1:10.008843:0,2:2:20.017686:0,2:2:20.020734:0,1:1:10.010367:0 |
When I route I should get
| waypoints | route | times | weight_name | weights |
| s,t | abc,cde,cde | 3.1s,3s,0s | duration | 3.1,3,0 |
# FIXME include/engine/guidance/assemble_geometry.hpp:95
@todo
Scenario: Start and target on the same edge
Given the query options
| annotations | true |
Given the node map
"""
a-------b
· ·
s t
"""
And the ways
| nodes |
| ab |
When I route I should get
| waypoints | route | distances | weights | times | annotation |
| s,t | abc,abc | 20m,0m | 20,0 | 2s,0s | 29:2.9:20.017685:0 |
| t,s | abc,abc | 20m,0m | 20,0 | 2s,0s | 29:2.9:20.017685:0 |
# FIXME include/engine/guidance/assemble_geometry.hpp:95
@todo
Scenario: Start and target on adjacent edges
Given the query options
| annotations | true |
Given the node map
"""
a-------b-------c
· ·
s t
"""
And the ways
| nodes |
| ab |
When I route I should get
| waypoints | route | distances | weights | times | annotation |
| s,t | abc,abc | 30m,0m | 31,0 | 3.1s,0s | 31:3.1:30.026527:0 |
| t,s | abc,abc | 30m,0m | 31,0 | 3.1s,0s | 31:3.1:30.026527:0 |
Scenario: Step weights -- way_function: fail if no weight or weight_per_meter property
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.forward_speed = 42
result.backward_speed = 42
end
"""
And the node map
"""
a---b
"""
And the ways
| nodes |
| ab |
And the data has been saved to disk
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
Then stderr should contain "There are no edges"
And it should exit with an error
Scenario: Step weights -- way_function: second way wins
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.duration = 42
result.weight = 35
end
"""
Given the node map
"""
a---b---c---d---e---f---g---h
"""
And the ways
| nodes |
| abcdef |
| abcdefgh |
When I route I should get
| waypoints | route | distance | weights | times |
| a,f | , | 100m | 25,0 | 30s,0s |
| f,a | , | 100m | 25,0 | 30s,0s |
| a,h | , | 140m +-1 | 35,0 | 42s,0s |
| h,a | , | 140m +-1 | 35,0 | 42s,0s |
Scenario: Step weights -- way_function: higher weight_per_meter is preferred
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.duration = 42
result.forward_rate = 1
result.backward_rate = 0.5
end
"""
Given the node map
"""
a---b---c---d---e---f---g---h
"""
And the ways
| nodes |
| abcdefgh |
| abcdef |
| fgh |
When I route I should get
| waypoints | route | distance | weights | times |
| a,f | , | 100m | 99.9,0 | 30s,0s |
| f,a | , | 100m | 199.8,0 | 30s,0s |
| a,h | , | 140m | 139.9,0 | 42s,0s |
| h,a | , | 140m | 279.8,0 | 42s,0s |
| f,h | , | 40m | 40,0 | 12s,0s |
| h,f | , | 40m | 80,0 | 12s,0s |
Scenario: Step weights -- segment_function
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.weight = 42
result.duration = 3
end
function segment_function (segment)
segment.weight = 1
segment.duration = 11
end
"""
Given the node map
"""
a---b---c---d---e---f---g---h
"""
And the ways
| nodes |
| abcdefgh |
| abcdef |
| fgh |
When I route I should get
| waypoints | route | distance | weights | times |
| a,f | , | 100m | 5,0 | 55s,0s |
| f,a | , | 100m | 5,0 | 55s,0s |
| a,h | , | 140m +-1 | 7,0 | 77s,0s |
| h,a | , | 140m +-1 | 7,0 | 77s,0s |
| f,h | , | 40m +-1 | 2,0 | 22s,0s |
| h,f | , | 40m +-1 | 2,0 | 22s,0s |
Scenario: Step weights -- segment_function and turn_function with weight precision
Given the profile file "testbot" extended with
"""
api_version = 1
properties.traffic_signal_penalty = 0
properties.u_turn_penalty = 0
properties.weight_name = 'steps'
properties.weight_precision = 3
function way_function(way, result)
result.forward_mode = mode.driving
result.backward_mode = mode.driving
result.weight = 42
result.duration = 3
end
function segment_function (segment)
segment.weight = 1.11
segment.duration = 100
end
function turn_function (turn)
print (turn.angle)
turn.weight = turn.angle / 100
turn.duration = turn.angle
end
"""
Given the node map
"""
a---b---c---d
e
"""
And the ways
| nodes |
| abcd |
| ce |
When I route I should get
| waypoints | route | distance | weights | times |
| a,c | , | 40m +-.1 | 3.119,0 | 289.9s,0s |
| a,e | ,, | 60m +-.1 | 3.119,1.11,0 | 289.9s,100s,0s |
| e,a | ,, | 60m +-.1 | 0.211,2.22,0 | 10.1s,200s,0s |
| e,d | ,, | 40m +-.1 | 2.009,1.11,0 | 189.9s,100s,0s |
| d,e | ,, | 40m +-.1 | 0.211,1.11,0 | 10.1s,100s,0s |