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

RoutingManager lane grouping enhancements #1593

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

RoutingManager lane grouping enhancements #1593

Elesbaan70 opened this issue Jun 5, 2022 · 0 comments
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 5, 2022

This issue depends on #1589.

Basic Non-Highway Routing Strategy

RoutingManager's logic for car lanes (non-highway rules) will be revised as follows:

  1. Outgoing lanes will be grouped first by lane group then by arrow direction. These are routing groups. For each outgoing routing group, the valid outgoing lane groups on all segments on the node will be identified.
  2. Incoming lane connections will be explicitly honored, then ignored by the remaining logic, as is done in the current code. However, this ought to be improved in the future.
  3. The lanes of the incoming routing group will be assigned to an outgoing lane group, proportionally according to the outgoing groups' lane counts. However, outgoing Standard and Express lane groups on the same segment will be treated as one for this operation.
  4. If the incoming routing group has at least as many lanes as the number of outgoing lane groups, an incoming lane will never be assigned to more than one outgoing lane group.
  5. Lane transitions will be defined from the incoming lanes into their assigned outgoing groups in a manner to avoid conflicts, or at least minimize them if there are more incoming than outgoing lanes.

The code will be structured to allow for node-based routing in the future. This will allow the routing of incoming segments to adapt to each other. Such an enhancement will also improve highway rules.

Valid Outgoing Lane Groups

A DisplacedInner lane group is exclusive if m_allowConnect is false and m_laneType is Vehicle. This excludes both Airports DLC cargo roads and TransportVehicle lanes from special CFI rules for displaced lanes.

Far Turn

An outgoing lane group is valid for far turns if its relative arrow direction is Left (RHT) or Right (LHT) and any one of the following conditions are met:

  1. It is a DisplacedOuter lane group on the nearest segment with incoming lanes in the clockwise (RHT) or counter-clockwise (LHT) direction.
  2. It is a DisplacedInner lane group.
  3. It is an Express or Standard lane group and there is no exclusive DisplacedInner lane group on the same segment. (The presence of an exclusive DisplacedInner lane group triggers the CFI rule.)

Near Turn

An outgoing lane group is valid for near turns if its relative arrow direction is Right (RHT) or Left (LHT) and any of the following conditions are met:

  1. It is a Standard or Express lane group.
  2. It is a DisplacedInner lane group that is not exclusive.

Forward, Standard Rule

  1. If the incoming routing group is DisplacedOuter and there is no DisplacedOuter outgoing lane group, it is handled as if it were DisplacedInner.
  2. If a segment contains the same type of outgoing lane group as the incoming routing group, then that is the valid outgoing lane group for the segment.
  3. Otherwise, if the incoming routing group is Express, then outgoing DisplacedInner and Standard lane groups are both valid.
  4. Otherwise, if the incoming routing group is DisplacedInner and an Express outgoing lane group is available, then that the valid outgoing lane group.
  5. Otherwise, the outgoing Standard lane group is selected as valid.

Forward, CFI Rule

When the incoming and outgoing segments both have exclusive DisplacedInner lanes and there are valid outgoing lane groups for far turns, the only valid outgoing lane group is DisplacedInner.

Highway Rules

When all segments on a node are highways, the existing code will be used for lane routing. Since highways do not have in-segment medians, they are beyond the scope of this project.

@Elesbaan70 Elesbaan70 added feature A new distinct feature triage Awaiting issue categorisation LANE ROUTING Feature: Lane arrows / connectors Dependent This issue is blocked by another issue. and removed triage Awaiting issue categorisation labels Jun 5, 2022
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

1 participant