Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaneArrowManager lane grouping enhancements #1590

Open
Tracked by #1223
Elesbaan70 opened this issue Jun 4, 2022 · 4 comments
Open
Tracked by #1223

LaneArrowManager lane grouping enhancements #1590

Elesbaan70 opened this issue Jun 4, 2022 · 4 comments
Assignees
Labels
Dependent This issue is blocked by another issue. feature A new distinct feature LANE ROUTING Feature: Lane arrows / connectors

Comments

@Elesbaan70
Copy link
Contributor

Elesbaan70 commented Jun 4, 2022

This issue depends on #1589.

Existing Arrows

The default lane arrow behavior in LaneArrowManager will change in certain lane grouping scenarios:

If the combination of incoming and outgoing lane counts makes these rules impossible to follow, the code will just try to behave as sensibly as possible.

Express and Service Lanes

  1. When there is a single segment in the far-turn direction and that segment has express/service lanes, the default number of far turn lanes will not exceed the number of outgoing express lanes in the target segment.
  2. When there is a single segment in the near-turn direction and that segment has express/service lanes, the default number of near turn lanes will not exceed the number of outgoing service lanes in the target segment.
  3. When the incoming segment has express/service lanes, express lanes will never be near-turn lanes, and service lanes will never be far-turn lanes.

image


Outer Displaced Lanes

  1. An outer displaced lane will never be a near-turn lane.
  2. When an outgoing segment has outer displaced lanes, at least one non-displaced far-turn lane will always be provided.
  3. When there is exactly one segment in the far-turn direction and it has outgoing outer displaced lanes, the number of far-turn lanes will always be at least one more than the number of outgoing displaced lanes.

image


Inner Displaced Lanes

  1. When there is a single segment in the far-turn direction and that segment has inner displaced lanes, the default number of far turn lanes will not exceed the number of outgoing displaced lanes in the target segment.
  2. When there is a single segment in the near-turn direction and that segment has inner displaced lanes, the default number of near turn lanes will not exceed the number of outgoing non-displaced lanes in the target segment.
  3. When the incoming segment has inner displaced lanes and a far turn is available, all incoming displaced lanes will be far-turn only.

image

New Arrows

A new enumeration, ExtLaneArrows, will provide extended arrows. Each extended arrow will be a special case of a basic directional arrow. LaneArrows will not be deprecated; both enumerations will coexist to ensure that we play as nicely as possible with anything that doesn't understand the extended arrows.

Explicit extended arrows are seen and selected by the user. It might not be immediately obvious to the user that these are just special cases of directional arrows, and that's okay.

Implicit extended arrows are not directly selected by the user, though timed traffic lights will reveal their existence because they can be controlled separately. When configuring lane arrows, the user will simply see a basic directional arrow.

Extended Arrow Special Case Of Applies To Meaning
CrossLeft Forward, explicitly RHT and LHT Forward traffic crosses leftward across a median or oncoming traffic
CrossRight Forward, explicitly RHT and LHT Forward traffic crosses rightward across a median or oncoming traffic
ExpressForward Forward, implicitly RHT and LHT Forward traffic moves from one express or displaced lane into another
ExpressLeft Left, implicitly RHT only Left-turning traffic leaves and/or enters a displaced outer lane
ExpressRight Right, implicitly LHT only Right-turning traffic leaves and/or enters a displaced outer lane

Lane Direction Calculation

Every possible lane transition will have a LaneArrow direction. This does not change.

In addition, every possible lane transition will have an ExtLaneArrow. This will be the same as its LaneArrow direction except in the following cases:

Forward Rules

The following rules apply when LaneArrow is Forward.

Incoming Lane Outgoing Lane Additional Rules ExtLaneArrow (RHT) ExtLaneArrow (LHT)
Outer, Inner DisplacedInner CFI Rule: Incoming segment has DisplacedInner and the incoming and outgoing segments are inverted in relation to each other, such that the "start node" flag is the same on both segment ends Forward Forward
Outer, Inner DisplacedInner Default behavior CrossLeft CrossRight
DisplacedInner Outer, Inner CrossRight CrossLeft
DisplacedInner DisplacedInner ExpressForward ExpressForward
DisplacedOuter DisplacedOuter ExpressForward ExpressForward
Inner Inner ExpressForward ExpressForward
Outer Inner CrossLeft CrossRight
Inner Outer CrossRight CrossLeft
DisplacedOuter not DisplacedOuter *misconfigured arrows/lane connections CrossRight CrossLeft
not DisplacedOuter DisplacedOuter *misconfigured arrows/lane connections CrossLeft CrossRight

Express Turn Rule

The express turn rule applies when the following conditions are true:

  1. Either the incoming or the outgoing lane, or both, are DisplacedOuter.
  2. LaneArrow is a Far Turn.
  3. The outgoing lane is in the nearest outgoing lane group in the direction of that turn.

When this rule is applied, ExtLaneArrow is the Express turn that corresponds to the turn's LaneArrow. i.e., ExpressLeft for RHT, or ExpressRight for LHT.

Note that it is impossible for ExpressRight to occur in right-hand traffic, or for ExpressLeft to occur in left-hand traffic.

@Elesbaan70 Elesbaan70 added feature A new distinct feature LANE ROUTING Feature: Lane arrows / connectors Dependent This issue is blocked by another issue. labels Jun 4, 2022
@Elesbaan70 Elesbaan70 self-assigned this Jun 4, 2022
@Elesbaan70
Copy link
Contributor Author

@kianzarrin When this reaches a working state, I'd like to collaborate on getting these arrows included as flags in AN, to facilitate road decals, etc.

@kianzarrin
Copy link
Collaborator

Sure. we can save space doing things like:

DisplacedInner = Displaced | Inner

@Elesbaan70
Copy link
Contributor Author

Sure. we can save space doing things like:

DisplacedInner = Displaced | Inner

In AN that may be a good optimization. It won't work here though, because the flags get aggregated, so they all have to be distinct.

@Elesbaan70
Copy link
Contributor Author

But having said that, I don't think those flags would be very useful in asset creation anyway. I think CrossLeft, CrossRight, and the express forward/left/right, will be the most useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependent This issue is blocked by another issue. feature A new distinct feature LANE ROUTING Feature: Lane arrows / connectors
Projects
None yet
Development

No branches or pull requests

2 participants