Presentation is loading. Please wait.

Presentation is loading. Please wait.

Traffic Lights Specification Niek. Overview Traffic lights are used everywhere Various algorithms: ◦Simple time-based traffic lights ◦Pressure sensors-based.

Similar presentations


Presentation on theme: "Traffic Lights Specification Niek. Overview Traffic lights are used everywhere Various algorithms: ◦Simple time-based traffic lights ◦Pressure sensors-based."— Presentation transcript:

1 Traffic Lights Specification Niek

2 Overview Traffic lights are used everywhere Various algorithms: ◦Simple time-based traffic lights ◦Pressure sensors-based systems ◦Connected systems (“green wave”) We don’t bother: ◦This is not an algorithm specification ◦We’ll define a spec to check whether a traffic lights system is correct ◦Not whether it’s the most optimal solution

3 Assumptions Placed at intersections ◦Typically T-type or cross-type intersections ◦Assumption: dedicated light/lane per direction ◦No deadlocks shall occur ◦Example:

4 Definition of an intersection type Intersection := {Road} type Road := {Lane} There is a relation between the number of roads at an intersection and the number of lanes per road:

5 Definition of lanes type Lane := (label :: Label, conflicts :: {Label}, color :: Color) type Color := Green | Red The label of a lane is unique in the scope of the intersection The conflicts labels are the lanes which cannot be green at the same time as the current lane

6 Conflicting lanes example Crossing lanes are not allowed Neither are lanes which arrive on the same road

7 Enforcing unique labels Labels are unique in the scope of the intersection: type Intersection := {Road} type Road := {Lane} type Lane := (label :: Label, conflicts :: {Label}, color :: Color)

8 Conflicting lanes If conflicting labels are specified, they must be part of the same intersection: type Intersection := {Road} type Road := {Lane} type Lane := (label :: Label, conflicts :: {Label}, color :: Color)

9 Correctness Conflicting lanes may not have a green light at the same time: type Intersection := {Road} type Road := {Lane} type Lane := (label :: Label, conflicts :: {Label}, color :: Color)

10 Correctness (cont’d) Intuitively: if a lane has a green light, all non-conflicting lanes should be green as well: This is not the case, example on next slide. type Intersection := {Road} type Road := {Lane} type Lane := (label :: Label, conflicts :: {Label}, color :: Color)

11 Correctness (cont’d) Example: In other words: an algorithm is required to select non-conflicting lanes with the highest “priority” ◦E.g. Longest wait time/most cars

12 Conclusion If a traffic lights system confirms this spec, no accidents will occur ◦At least not due to conflicting lights Whether or not the system is optimized, depends on the algorithm Real-life issues which make the problem harder: ◦Pedestrian paths/lights crossing the lanes ◦Merged lanes/lights

13 Conclusion (cont’d) 0101 5454 2 3 Intersection = { {(0, {2, 4, 3}, Green), (1, {4}, Green)}, {(2, {0, 4, 5}, Red), (3, {0}, Red)}, {(4, {0, 1, 3}, Red), (5, {2}, Green)} }


Download ppt "Traffic Lights Specification Niek. Overview Traffic lights are used everywhere Various algorithms: ◦Simple time-based traffic lights ◦Pressure sensors-based."

Similar presentations


Ads by Google