implement flag edge-weight-updates-over-factor, to log edge weight

updates over provided x factor
This commit is contained in:
karenzshea
2016-09-12 12:16:56 -04:00
committed by Moritz Kobitzsch
parent eafe3fa928
commit 3d5a53566c
7 changed files with 103 additions and 22 deletions
@@ -0,0 +1,30 @@
@contract @options @edge-weight-updates-over-factor
Feature: osrm-contract command line option: edge-weight-updates-over-factor
Background: Log edge weight updates over given factor
Scenario: Logging weight with updates over factor of 2, long segment
Given the node locations
| node | lat | lon |
| a | 0.1 | 0.1 |
| b | .05 | 0.1 |
| c | 0.3 | 0.1 |
And the ways
| nodes | highway |
| ab | residential |
| ac | primary |
Given the profile "testbot"
Given the extract extra arguments "--generate-edge-lookup"
Given the speed file
"""
1,2,100
1,3,100
"""
And the data has been extracted
When I run "osrm-contract --edge-weight-updates-over-factor 2 --segment-speed-file {speeds_file} {processed_file}"
And stderr should contain "weight updates"
And stderr should contain "New speed: 100 kph"
And I route I should get
| from | to | route | speed |
| a | b | ab,ab | 100 km/h |
| a | c | ac,ac | 100 km/h |
+1 -1
View File
@@ -6,7 +6,7 @@ Feature: osrm-contract command line options: version
Background:
Given the profile "testbot"
Scenario: osrm-contract - Version, short
When I run "osrm-contract --v"
Then stderr should be empty
+4
View File
@@ -86,6 +86,10 @@ module.exports = function () {
assert.equal(this.stdout.split('\n').length - 1, parseInt(lines));
});
this.Then(/^stderr should contain (\d+) lines?$/, (lines) => {
assert.equal(this.stderr.split('\n').length - 1, parseInt(lines));
});
this.Then(/^datasource names should contain "(.+)"$/, (expectedData) => {
var actualData = fs.readFileSync(this.processedCacheFile + '.datasource_names', {encoding:'UTF-8'}).trim().split('\n').join(',');
assert.equal(actualData, expectedData);