Skip to content

Commit

Permalink
path unpacking in manyToMany function in MLD
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshkaj committed Apr 23, 2018
1 parent 14860b6 commit 1ac22d0
Show file tree
Hide file tree
Showing 8 changed files with 462 additions and 37 deletions.
2 changes: 1 addition & 1 deletion cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ module.exports = {
verify: '--strict --tags ~@stress --tags ~@todo --tags ~@mld-only -f progress --require features/support --require features/step_definitions',
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
all: '--strict --require features/support --require features/step_definitions',
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions -f progress'
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@ch --require features/support --require features/step_definitions'
};
2 changes: 1 addition & 1 deletion features/support/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
33 changes: 24 additions & 9 deletions features/testbot/distance_matrix.feature
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
@matrix @testbot @ch
@matrix @testbot
Feature: Basic Distance Matrix
# note that results of travel distance are in metres

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 minimal network
@ch
Scenario: Testbot - Travel distance matrix of minimal network only
Given the node map
"""
a b
a b c d e f g h i j k l m n o p q r s t u v x y z
"""

And the ways
| nodes |
| ab |
| abcdefghijklmnopqrstuvxyz|

When I request a travel distance matrix I should get
| | a | b |
| a | 0 | 100 |
| b | 100 | 0 |
| | a | b | c | d | e | f | g | h | i | j | k | l | m | n |
| a | 0 | 100 | 200 | 299.9 | 399.9 | 499.9 | 599.9 | 699.8 | 799.9 | 899.9 | 999.9 | 1099.9 | 1199.8 | 1299.8 |
| b | 100 | 0 | 100 | 200 | 299.9 | 399.9 | 499.9 | 599.9 | 700 | 799.9 | 899.9 | 999.9 | 1099.9 | 1199.8 |

@ch
Scenario: Testbot - Travel distance matrix of minimal network with toll exclude
Given the query options
| exclude | toll |
Expand All @@ -45,6 +47,7 @@ Feature: Basic Distance Matrix
| c | | | 0 | 100 |
| d | | | 100 | 0 |

@ch
Scenario: Testbot - Travel distance matrix of minimal network with motorway exclude
Given the query options
| exclude | motorway |
Expand All @@ -66,7 +69,7 @@ Feature: Basic Distance Matrix
| | a | b | c | d |
| a | 0 | 300 | 100 | 200 |


@ch
Scenario: Testbot - Travel distance matrix of minimal network disconnected motorway exclude
Given the query options
| exclude | motorway |
Expand All @@ -89,6 +92,7 @@ Feature: Basic Distance Matrix
| a | 0 | 50 | |


@ch
Scenario: Testbot - Travel distance matrix of minimal network with motorway and toll excludes
Given the query options
| exclude | motorway,toll |
Expand All @@ -110,6 +114,7 @@ Feature: Basic Distance Matrix
| | a | b | e | g |
| a | 0 | 100 | | |

@ch
Scenario: Testbot - Travel distance matrix with different way speeds
Given the node map
"""
Expand Down Expand Up @@ -140,6 +145,7 @@ Feature: Basic Distance Matrix
| c | 200 |
| d | 299.9 |


Scenario: Testbot - Travel distance matrix of small grid
Given the node map
"""
Expand All @@ -162,6 +168,7 @@ Feature: Basic Distance Matrix
| e | 200 | 100 | 0 | 100 |
| f | 299.9 | 200 | 100 | 0 |

@ch
Scenario: Testbot - Travel distance matrix of network with unroutable parts
Given the node map
"""
Expand All @@ -177,6 +184,7 @@ Feature: Basic Distance Matrix
| a | 0 | 100 |
| b | | 0 |

@ch
Scenario: Testbot - Travel distance matrix of network with oneways
Given the node map
"""
Expand All @@ -197,6 +205,7 @@ Feature: Basic Distance Matrix
| d | 200 | 299.9 | 0 | 300 |
| e | 299.9 | 399.9 | 100 | 0 |

@ch
Scenario: Testbot - Rectangular travel distance matrix
Given the node map
"""
Expand Down Expand Up @@ -256,6 +265,7 @@ Feature: Basic Distance Matrix
| f | 299.9 | 200 | 100 | 0 |


@ch
Scenario: Testbot - Travel distance 3x2 matrix
Given the node map
"""
Expand All @@ -277,6 +287,7 @@ Feature: Basic Distance Matrix
| a | 100 | 200 | 299.9 |
| b | 0 | 100 | 200 |

@ch
Scenario: Testbot - All coordinates are from same small component
Given a grid size of 300 meters
Given the extract extra arguments "--small-component-size 4"
Expand All @@ -299,6 +310,7 @@ Feature: Basic Distance Matrix
| f | 0 | 300 |
| g | 300 | 0 |

@ch
Scenario: Testbot - Coordinates are from different small component and snap to big CC
Given a grid size of 300 meters
Given the extract extra arguments "--small-component-size 4"
Expand Down Expand Up @@ -335,6 +347,7 @@ Feature: Basic Distance Matrix
| h | 0 | 300 | 0 | 300 |
| i | 300 | 0 | 300 | 0 |

@ch
Scenario: Testbot - Travel distance matrix with loops
Given the node map
"""
Expand All @@ -356,7 +369,7 @@ Feature: Basic Distance Matrix
| 3 | 399.9 | 499.9 | 0 | 100 |
| 4 | 299.9 | 399.9 | 699.9 | 0 |


@ch
Scenario: Testbot - Travel distance matrix based on segment durations
Given the profile file
"""
Expand Down Expand Up @@ -398,6 +411,7 @@ Feature: Basic Distance Matrix
| d | 299.9 | 200 | 100 | 0 | 300 |
| e | 399.9 | 300 | 200 | 300 | 0 |

@ch
Scenario: Testbot - Travel distance matrix for alternative loop paths
Given the profile file
"""
Expand Down Expand Up @@ -445,6 +459,7 @@ Feature: Basic Distance Matrix
| 7 | 299.9 | 200 | 599.9 | 499.9 | 899.9 | 799.9 | 0 | 1099.8 |
| 8 | 399.9 | 300 | 699.9 | 599.9 | 999.8 | 899.9 | 100 | 0 |

@ch
Scenario: Testbot - Travel distance matrix with ties
Given the node map
"""
Expand Down
188 changes: 188 additions & 0 deletions features/testbot/distance_matrix_mld.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
@mld @matrix @testbot
Feature: Basic Distance Matrix
# note that results are travel time, specified in 1/10th of seconds
# since testbot uses a default speed of 100m/10s, the result matches
# the number of meters as long as the way type is the default 'primary'

Background:
Given the profile "testbot"
And the partition extra arguments "--small-component-size 1 --max-cell-sizes 2,4,8,16"

Scenario: Testbot - mld Travel matrix of minimal network only
Given the node map
"""
a b
"""

And the ways
| nodes |
| ab |

When I request a travel distance matrix I should get
| | a | b |
| a | 0 | 9.9 |
| b | 9.9 | 0 |

Scenario: Testbot - mld Travel matrix of minimal network with excludes
Given the query options
| exclude | toll |

Given the node map
"""
a b
c d
"""

And the ways
| nodes | highway | toll | # |
| ab | motorway | | not drivable for exclude=motorway |
| cd | primary | | always drivable |
| ac | highway | yes | not drivable for exclude=toll and exclude=motorway,toll |
| bd | highway | yes | not drivable for exclude=toll |

When I request a travel distance matrix I should get
| | a | b | c | d |
| a | 0 | 9.997721 | | |
| b | 9.997721 | 0 | | |
| c | | | 0 | 9.997724 |
| d | | | 9.997724 | 0 |

Scenario: Testbot - mld Travel matrix of minimal network with different exclude
Given the query options
| exclude | motorway |

Given the node map
"""
a b
c d
"""

And the ways
| nodes | highway | toll | # |
| ab | motorway | | not drivable for exclude=motorway |
| cd | primary | | always drivable |
| ac | highway | yes | not drivable for exclude=toll and exclude=motorway,toll |
| bd | highway | yes | not drivable for exclude=toll |

When I request a travel distance matrix I should get
| | a | b | c | d |
| a | 0 | 39.9 | 9.9 | 29.9 |
| b | 39.9 | 0 | 29.9 | 9.9 |
| c | 10 | 29.9 | 0 | 19.9 |
| d | 29.9 | 9.9 | 19.9 | 0 |

Scenario: Testbot - mld Travel matrix of minimal network with excludes combination
Given the query options
| exclude | motorway,toll |

Given the node map
"""
a b
c d
"""

And the ways
| nodes | highway | toll | # |
| ab | motorway | | not drivable for exclude=motorway |
| cd | primary | | always drivable |
| ac | highway | yes | not drivable for exclude=toll and exclude=motorway,toll |
| bd | highway | yes | not drivable for exclude=toll |

When I request a travel distance matrix I should get
| | a | b | c | d |
| a | 0 | 9.997724 | 0 | 9.997724 |
| b | 9.997724 | 0 | 9.997724 | 0 |
| c | 0 | 9.997724 | 0 | 9.997724 |
| d | 9.997724 | 0 | 9.997724 | 0 |

Scenario: Testbot - mld Travel matrix with different way speeds
Given the node map
"""
a b c d
"""

And the ways
| nodes | highway |
| ab | primary |
| bc | secondary |
| cd | tertiary |

When I request a travel distance matrix I should get
| | a |
| a | 0 |
| b | 10 |
| c | 30 |
| d | 60 |

Scenario: Testbot - mld Travel matrix with fuzzy match
Given the node map
"""
a b
"""

And the ways
| nodes |
| ab |

When I request a travel distance matrix I should get
| | a | b |
| a | 0 | 10 |
| b | 10 | 0 |

Scenario: Testbot - mld Travel 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 | 10 | 20 | 30 |
| b | 10 | 0 | 10 | 20 |
| e | 20 | 10 | 0 | 10 |
| f | 30 | 20 | 10 | 0 |

Scenario: Testbot - mld Travel matrix of network with unroutable parts
Given the node map
"""
a b
"""

And the ways
| nodes | oneway |
| ab | yes |

When I request a travel distance matrix I should get
| | a | b |
| a | 0 | 10 |
| b | | 0 |

Scenario: Testbot - mld Travel matrix of network with oneways
Given the node map
"""
x a b y
d e
"""

And the ways
| nodes | oneway |
| abeda | yes |
| xa | |
| by | |


When I request a travel distance matrix I should get
| | x | y | d | e |
| x | 0 | 30 | 40 | 30 |
| y | 50 | 0 | 30 | 20 |
| d | 20 | 30 | 0 | 30 |
| e | 30 | 40 | 10 | 0 |
Loading

0 comments on commit 1ac22d0

Please sign in to comment.