@@ -32,14 +32,14 @@ Feature: Car - Handle traffic lights
3232 | l | traffic_signals |
3333
3434 When I route I should get
35- | from | to | time | # |
35+ | from | to | time | # |
3636 | 1 | 2 | 11 .1s | no turn with no traffic light |
3737 | 3 | 4 | 13 .1s | no turn with traffic light |
3838 | g | j | 18 .7s | turn with no traffic light |
3939 | k | n | 20 .7s | turn with traffic light |
4040
4141
42- Scenario : Car - Traffic signal direction
42+ Scenario : Car - Traffic signal direction straight
4343 Given the node map
4444 """
4545 a-1-b-2-c
@@ -112,14 +112,14 @@ Feature: Car - Handle traffic lights
112112
113113
114114
115- Scenario : Car - Encounters a traffic light
115+ Scenario : Car - Encounters a traffic light direction
116116 Given the node map
117117 """
118- a f k
119- | | |
120- b-c-d h-g-i l-m-n
121- | | |
122- e j o
118+ a f k p
119+ | | | |
120+ b-c-d h-g-i l-m-n q-r-s
121+ | | | |
122+ e j o t
123123
124124 """
125125
@@ -131,53 +131,70 @@ Feature: Car - Handle traffic lights
131131 | fgj | primary |
132132 | lmn | primary |
133133 | kmo | primary |
134+ | qrs | primary |
135+ | prt | primary |
134136
135137 And the nodes
136138 | node | highway | traffic_signals :direction |
137- | g | traffic_signals | forward |
138- | m | traffic_signals | backward |
139+ | g | traffic_signals | |
140+ | m | traffic_signals | forward |
141+ | r | traffic_signals | backward |
139142
140143
141144 When I route I should get
145+ # Base case
142146 | from | to | time | # |
143- | a | d | 21 .9s | no turn with no traffic light |
144- | a | e | 22 .2s | no turn with traffic light |
145147 | a | b | 18 .7s | turn with no traffic light |
146- | e | b | 21 .9s | no turn with no traffic light |
147- | e | a | 22 .2s | no turn with traffic light |
148+ | a | e | 22 .2s | no turn with no traffic light |
149+ | a | d | 21 .9s | turn with no traffic light |
150+ | e | b | 21 .9s | turn with no traffic light |
151+ | e | a | 22 .2s | no turn with no traffic light |
148152 | e | d | 18 .7s | turn with no traffic light |
149- | d | e | 21 .9s | no turn with no traffic light |
150- | d | b | 11s | no turn with traffic light |
153+ | d | e | 21 .9s | turn with no traffic light |
154+ | d | b | 11s | no turn with no traffic light |
151155 | d | a | 18 .7s | turn with no traffic light |
152- | b | a | 21 .9s | no turn with no traffic light |
153- | b | d | 11s | no turn with traffic light |
156+ | b | a | 21 .9s | turn with no traffic light |
157+ | b | d | 11s | no turn with no traffic light |
154158 | b | e | 18 .7s | turn with no traffic light |
155-
156- | f | i | 23 . 9s | no turn with no traffic light |
159+ # All have traffic lights - 2s penalty
160+ | f | h | 20 . 7s | turn with traffic light |
157161 | f | j | 24 .2s | no turn with traffic light |
158- | f | h | 20 . 7s | turn with no traffic light |
159- | j | h | 21 .9s | no turn with no traffic light |
160- | j | f | 22 .2s | no turn with traffic light |
161- | j | i | 18 .7s | turn with no traffic light |
162- | i | j | 21 .9s | no turn with no traffic light |
163- | i | h | 11s | no turn with traffic light |
164- | i | f | 18 .7s | turn with no traffic light |
165- | h | f | 23 .9s | no turn with no traffic light |
162+ | f | i | 23 . 9s | turn with traffic light |
163+ | j | h | 23 .9s | turn with traffic light |
164+ | j | f | 24 .2s | no turn with traffic light |
165+ | j | i | 20 .7s | turn with traffic light |
166+ | i | j | 23 .9s | turn with traffic light |
167+ | i | h | 13s | no turn with traffic light |
168+ | i | f | 20 .7s | turn with traffic light |
169+ | h | f | 23 .9s | turn with traffic light |
166170 | h | i | 13s | no turn with traffic light |
167- | h | j | 20 .7s | turn with no traffic light |
168-
169- | k | n | 21 .9s | no turn with no traffic light |
170- | k | o | 22 .2s | no turn with traffic light |
171- | k | l | 18 .7s | turn with no traffic light |
172- | o | l | 23 .9s | no turn with no traffic light |
173- | o | k | 24 .2s | no turn with traffic light |
174- | o | n | 20 .7s | turn with no traffic light |
175- | n | o | 23 .9s | no turn with no traffic light |
176- | n | l | 13s | no turn with traffic light |
177- | n | k | 20 .7s | turn with no traffic light |
178- | l | k | 21 .9s | no turn with no traffic light |
179- | l | n | 11s | no turn with traffic light |
180- | l | o | 18 .7s | turn with no traffic light |
171+ | h | j | 20 .7s | turn with traffic light |
172+ # Front direction have traffic lights - 2s penalty
173+ | k | l | 20 .7s | turn with traffic light |
174+ | k | o | 24 .2s | no turn with traffic light |
175+ | k | n | 23 .9s | turn with traffic light |
176+ | o | l | 21 .9s | turn with no traffic light |
177+ | o | k | 22 .2s | no turn with no traffic light |
178+ | o | n | 18 .7s | turn with no traffic light |
179+ | n | o | 21 .9s | turn with no traffic light |
180+ | n | l | 11s | no turn with no traffic light |
181+ | n | k | 18 .7s | turn with no traffic light |
182+ | l | k | 23 .9s | turn with traffic light |
183+ | l | n | 13s | no turn with traffic light |
184+ | l | o | 20 .7s | turn with traffic light |
185+ # Reverse direction have traffic lights - 2s penalty
186+ | p | q | 18 .7s | turn with no traffic light |
187+ | p | t | 22 .2s | no turn with no traffic light |
188+ | p | s | 21 .9s | turn with no traffic light |
189+ | t | q | 23 .9s | turn with traffic light |
190+ | t | p | 24 .2s | no turn with traffic light |
191+ | t | s | 20 .7s | turn with traffic light |
192+ | s | t | 23 .9s | turn with traffic light |
193+ | s | q | 13s | no turn with traffic light |
194+ | s | p | 20 .7s | turn with traffic light |
195+ | q | p | 21 .9s | turn with no traffic light |
196+ | q | s | 11s | no turn with no traffic light |
197+ | q | t | 18 .7s | turn with no traffic light |
181198
182199
183200 Scenario : Traffic Signal Geometry
@@ -343,3 +360,106 @@ Feature: Car - Handle traffic lights
343360 | from | to | route | speed | weights | time | distances | a :datasources | a :nodes | a :speed | a :duration | a :weight |
344361 | a | c | abc ,abc | 65 km /h | 22 .2 ,0 | 22 .2s | 400m ,0m | 1 :0 | 1 :2 :3 | 18 :18 | 11 .1 :11 .1 | 11 .1 :11 .1 |
345362 | c | a | abc ,abc | 60 km /h | 24 .2 ,0 | 24 .2s | 400m ,0m | 0 :1 | 3 :2 :1 | 18 :18 | 11 .1 :11 .1 | 11 .1 :11 .1 |
363+
364+
365+ Scenario : Car - Traffic signal straight direction with edge compression
366+ Given the node map
367+ """
368+ a-1-b - c - d-2-e
369+
370+ """
371+
372+ And the ways
373+ | nodes | highway |
374+ | abcde | primary |
375+
376+ And the nodes
377+ | node | highway | traffic_signals :direction |
378+ | c | traffic_signals | forward |
379+
380+ When I route I should get
381+ | from | to | time | weight | # |
382+ | 1 | 2 | 35 .3s | 35 .3 | no turn with traffic light |
383+ | 2 | 1 | 33 .3s | 33 .3 | no turn with no traffic light |
384+
385+
386+ Scenario : Car - Traffic signal turn direction with edge compression
387+ Given the node map
388+ """
389+ d
390+ |
391+ 2
392+ |
393+ a-1-b - c - f
394+ |
395+ e
396+
397+ j
398+ |
399+ 4
400+ |
401+ g-3-h - i - k
402+ |
403+ l
404+
405+ """
406+
407+ And the ways
408+ | nodes | highway |
409+ | abc | primary |
410+ | cf | primary |
411+ | fd | primary |
412+ | fe | primary |
413+ | ghi | primary |
414+ | ik | primary |
415+ | kj | primary |
416+ | kl | primary |
417+
418+ And the nodes
419+ | node | highway | traffic_signals :direction |
420+ | k | traffic_signals | forward |
421+
422+ When I route I should get
423+ | from | to | time | weight | # |
424+ | 1 | 2 | 44 .2s | 44 .2 | turn with no traffic light |
425+ | 2 | 1 | 41s | 41 | turn with no traffic light |
426+ | 3 | 4 | 46 .2s | 46 .2 | turn with traffic light |
427+ | 4 | 3 | 41s | 41 | turn with no traffic light |
428+
429+
430+ Scenario : Car - Traffic signal turn direction with turn restriction
431+ Given the node map
432+ """
433+ d
434+ |
435+ 2
436+ |
437+ a-1-b - c - f
438+ |
439+ e
440+
441+ """
442+
443+ And the ways
444+ | nodes | highway |
445+ | abc | primary |
446+ | cf | primary |
447+ | fd | primary |
448+ | fe | primary |
449+
450+ And the nodes
451+ | node | highway | traffic_signals :direction |
452+ | f | traffic_signals | forward |
453+
454+ And the relations
455+ | type | way :from | way :to | way :via | restriction |
456+ | restriction | abc | fe | cf | no_right_turn |
457+
458+ And the relations
459+ | type | way :from | way :to | node :via | restriction |
460+ | restriction | df | fc | f | right_turn_only |
461+
462+ When I route I should get
463+ | from | to | time | weight | # |
464+ | 1 | 2 | 46 .2s | 46 .2 | turn with traffic light |
465+ | 2 | 1 | 41s | 41 | turn with no traffic light |
0 commit comments